Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to skip resolver nameserver request #4988

Merged
merged 1 commit into from
Mar 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions runtime/oti/jvminit.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ enum INIT_STAGE {
#define VMOPT_XXUSECONTAINERSUPPORT "-XX:+UseContainerSupport"
#define VMOPT_XXNOUSECONTAINERSUPPORT "-XX:-UseContainerSupport"

#define VMOPT_XXREADIPINFOFORRAS "-XX:+ReadIPInfoForRAS"
#define VMOPT_XXNOREADIPINFOFORRAS "-XX:-ReadIPInfoForRAS"

#define MAPOPT_AGENTLIB_JDWP_EQUALS "-agentlib:jdwp="

#define MAPOPT_XCOMP "-Xcomp"
Expand Down
9 changes: 8 additions & 1 deletion runtime/vm/jvminit.c
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,14 @@ IDATA VMInitStages(J9JavaVM *vm, IDATA stage, void* reserved) {
* defer initialization of network data until after heap allocated, since the intialization
* can initiate DLL loads which prevent allocation of large heaps.
*/
populateRASNetData(vm, vm->j9ras);
argIndex = FIND_AND_CONSUME_ARG(EXACT_MATCH, VMOPT_XXREADIPINFOFORRAS, NULL);
argIndex2 = FIND_AND_CONSUME_ARG(EXACT_MATCH, VMOPT_XXNOREADIPINFOFORRAS, NULL);
if (argIndex >= argIndex2) {
JVMINIT_VERBOSE_INIT_VM_TRACE(vm, "\t\tenabled network query to determine host name and IP address for RAS.\n");
populateRASNetData(vm, vm->j9ras);
} else {
JVMINIT_VERBOSE_INIT_VM_TRACE(vm, "\t\tdisabled network query to determine host name and IP address for RAS.\n");
}
#endif
consumeVMArgs(vm, vm->vmArgsArray);
if (FIND_AND_CONSUME_ARG(EXACT_MATCH, VMOPT_XXALLOWVMSHUTDOWN, NULL) >= 0) {
Expand Down
17 changes: 16 additions & 1 deletion test/functional/cmdLineTests/cmdLineTest_J9tests/j9tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<!DOCTYPE suite SYSTEM "cmdlinetester.dtd">

<suite id="J9 Command-Line Option Tests" timeout="180">

<variable name="READIPINFOFORRAS" value="-XX:+ReadIPInfoForRAS"/>
<variable name="NOREADIPINFOFORRAS" value="-XX:-ReadIPInfoForRAS"/>
<variable name="READIPINFOFORRAS_MESSAGE" value="enabled network query to determine host name and IP address for RAS."/>
<variable name="NOREADIPINFOFORRAS_MESSAGE" value="disabled network query to determine host name and IP address for RAS."/>

<test id="Verify Generate a javacore to STDOUT">
<command>$EXE$ -Xdump:java:events=vmstart,file=/STDOUT/</command>
<output type="success" caseSensitive="yes" regex="no">TITLE subcomponent dump routine</output>
Expand All @@ -44,5 +48,16 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<output type="failure" caseSensitive="yes" regex="no">Exception:</output>
</test>

<test id="test -XX:-ReadIPInfoForRAS -XX:+ReadIPInfoForRAS">
<command>$EXE$ $NOREADIPINFOFORRAS$ $READIPINFOFORRAS$ -verbose:init -version</command>
<output type="success" caseSensitive="yes" regex="no">$READIPINFOFORRAS_MESSAGE$</output>
<output type="failure" caseSensitive="yes" regex="no">$NOREADIPINFOFORRAS_MESSAGE$</output>
</test>

<test id="test -XX:+ReadIPInfoForRAS -XX:-ReadIPInfoForRAS">
<command>$EXE$ $READIPINFOFORRAS$ $NOREADIPINFOFORRAS$ -verbose:init -version</command>
<output type="success" caseSensitive="yes" regex="no">$NOREADIPINFOFORRAS_MESSAGE$</output>
<output type="failure" caseSensitive="yes" regex="no">$READIPINFOFORRAS_MESSAGE$</output>
</test>
</suite>