RFR: 6875: Add agent MXBean operation to return instrumented xml configuration [v3]

Jessye Coleman-Shapiro jescolem at openjdk.java.net
Wed Aug 19 19:44:11 UTC 2020


On Wed, 19 Aug 2020 16:51:04 GMT, Marcus Hirt <hirt at openjdk.org> wrote:

>> Jessye Coleman-Shapiro has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add javadoc and test for retrieving an invalid configuration
>
> agent/src/test/java/org/openjdk/jmc/agent/test/TestRetrieveEventProbes.java line 82:
> 
>> 81: 		String invalidConfiguration = XML_TEST_DESCRIPTION.concat("</jfragent>");
>> 82: 		mbean.defineEventProbes(invalidConfiguration);
>> 83: 		Assert.assertEquals(mbean.retrieveEventProbes(), initialConfiguration);
> 
> This is just a matter of taste, but I would have expected the definition to fail exceptionally with information about
> the invalid configuration, hopefully giving a hint of what went wrong (in the case of e.g. bad XML where the XML went
> wrong, simply propagating the exception). And then (just as it is done) let subsequent reads of the configuration
> return the last valid one.

Yes, I do agree with you - right now how it is handled is an error is logged when the definition fails, but no
exception is thrown.  Since this is more specific to `defineEventProbes` instead of `retrieveEventProbes`, perhaps a
separate issue should be created to address this?

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

PR: https://git.openjdk.java.net/jmc/pull/99


More information about the jmc-dev mailing list