RFR: 8332303: Better JMX interoperability with older JDKs, after removing Subject Delegation

Kevin Walls kevinw at openjdk.org
Mon May 20 14:22:03 UTC 2024


On Thu, 16 May 2024 08:25:17 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

>>> > ...Is there any way to run jconsole in a way that would result in it passing a non-empty delegationSubjects, resulting in this issue still reproducing?
>>> 
>>> I don't think there is, JConsole has a hard null in this call. Also I don't see in JConsole any calls of getMBeanServerConnection with a Subject being passed, that's the main gateway method to use the removed feature.
>>> 
>>> If there was a way to use Subject Delegation with JConsole (or with anything else), and you try to attach to a jdk-23, then that will fail with the UnsupportedOperationException and that's what we want as the feature is gone. Realistically it's a feature with no known usage as discussed in the deprecation and removal changes.
>> 
>> If jconsole is passing null, why is it triggering this exception?
>
>> If jconsole is passing null, why is it triggering this exception?
> 
> JConsole passes null, but when running on an older jdk, the older RMIConnector actually "promotes" it to an array before making the remote call.  If you connect to a jdk-23 with the removal, the exception is thrown.
> 
> (JConsole running on jdk-23 can connect to jdk-23 fine.)
> (Also just to note, a jdk-23 JConsole can connect to an older JDK and show the MBean tab OK.)

> @kevinjwalls I assume the RN for the removal of the subject delegation feature will need to be adjusted once this current PR is integrated.

When this fix goes in, there will be a window of builds between jdk 23+18 to jdk-23+build_with_this_fix, where older JMX clients using addNotificationListener() will see an exception.  I wasn't going to highlight this in the RN, I thought JDK-8332303 looks quite discoverable already.  If the RN is the place to discuss temporary and now-fixed issues with selection of earlier builds before release, I could add something there.

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

PR Comment: https://git.openjdk.org/jdk/pull/19253#issuecomment-2120560237


More information about the serviceability-dev mailing list