On Thu, 11 May 2023 11:42:38 GMT, Kevin Walls <[email protected]> wrote:

> Java Discovery Protocol (perhaps a hidden feature, but maybe should be more 
> widely known!) and -XX:-UsePerfData together cause a failure to startup.
> 
> PerfData is the mechanism for communicating the URL and other properties for 
> remote management, so disabling PerfData clearly breaks this.  But there 
> should be a clearer message, and not a fatal error.
> 
> e.g.
> $ java -XX:-UsePerfData  -Dcom.sun.management.jmxremote.autodiscovery=true 
> -Dcom.sun.management.jmxremote.port=0 
> -Dcom.sun.management.jmxremote.authenticate=false 
> -Dcom.sun.management.jmxremote.ssl=false --version
> Warning: Exception thrown by the agent : JDP not starting, PerfData not 
> available: Empty PerfData buffer
> java 21-internal 2023-09-19 LTS
> ...etc...
> 
> The use of PerfData is superior to the previous hard-coding of knowledge of 
> the URL protocol and structure, and is required to communicate a dynamically 
> assigned port (JDK-8167337).

src/jdk.management.agent/share/classes/jdk/internal/agent/Agent.java line 506:

> 504:                 remoteProps = ConnectorAddressLink.importRemoteFrom(0);
> 505:             } catch (IOException ioe) {
> 506:                 warning(AGENT_EXCEPTION, "JDP not starting, PerfData not 
> available: " + ioe.getMessage());

Is this the only possible reason?

As per the JBS link I added there is a general problem about the Java side of 
the "Perf" code not knowing/realizing that `UsePerfData` can be disabled. 
Ideally there would be a way to query this, or a specific type of exception 
that could be thrown to report it.

Will the user understand what this message means? Should it explicitly say 
"please ensure -XX:-UsePerfData" is not set?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13928#discussion_r1191905273

Reply via email to