RFR: 8336401: Remove the option onjcmd from the jdwp agent [v2]

Johannes Bechberger jbechberger at openjdk.org
Tue Oct 8 06:58:13 UTC 2024


On Mon, 7 Oct 2024 16:17:59 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use port 0 in TestAgentEvent
>
> test/jdk/jdk/jfr/event/runtime/TestAgentEvent.java line 68:
> 
>> 66:  *      testJavaDynamic
>> 67:  *
>> 68:  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=:5005
> 
> This use of port 5005 could possibly conflict with other tests running in parallel that were already dynamically assigned this port. Is there a reason it can't remain "any"?

Using `any` leads to the following error:


ERROR: transport error 103: invalid port number specified
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:700]


This doesn't happen with onjcmd because it delays parsing the port till the debugging is enabled. Using `0` as @schmelter-sap suggested, should prevent any issues.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21387#discussion_r1791299808


More information about the serviceability-dev mailing list