-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8316649: JMX connection timeout cannot be changed and uses the default of 0 (infinite) #16856
8316649: JMX connection timeout cannot be changed and uses the default of 0 (infinite) #16856
Conversation
👋 Welcome back kevinw! A progress list of the required criteria for merging this PR into |
@kevinjwalls The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
I don't think that's a good idea. AFAIK the RMIClientSocketFactory is serialized and sent by the server to the client. This means, unless I'm mistaken, that you will not be able to use JDK 21 JConsole to connect to a JDK 22 VM. Try it :-) |
Thanks, that's right it is a bad interoperability problem! The other possibility was use of RMISocketFactory::setSocketFactory on the JMX client end. This lets us substitute in a preferred socket factory before making a connection, and one which can implement its own timeout. This is awkward as it affects the whole process. For JMX apps such as JConsole etc this is fine, but in other situations it may have side-effects on other RMI activity. At the moment the demand for the timeout is not strong, and the behaviour is what it has been for many years, so I am going to close this without progressing it. |
JMX RMI Connections should use a timeout on the Socket connect call by default.
JMX Connections use RMI and some connection failures never terminate. The hang described in 8316649 is hard to reproduce manually: the description says it can be caused by a firewall that never returns a response.
Changing the base RMI implementation may not be desirable at this time.
JMX can use a new ClientSocketFactory for RMI which implements the connect timeout, which can recognise a new JMX-specific property
com.sun.management.jmxremote.rmi.tcpConnectTimeout
(named like the existing com.sun.management.jmxremote... properties)
Defaulting to a 1 minute timeout on connect has no effect on existing tests, and should go unnoticed unless there really is a significant connection delay. Specifying zero for the new System Property will use the old technique of a connect with no timeout.
This can be tested, but it is not realistically usable: although specifying a 1 millisecond timeout will often fail (as expected/desired for the test), it will very often pass as the connection happens immediately.
Progress
Issues
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16856/head:pull/16856
$ git checkout pull/16856
Update a local copy of the PR:
$ git checkout pull/16856
$ git pull https://git.openjdk.org/jdk.git pull/16856/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16856
View PR using the GUI difftool:
$ git pr show -t 16856
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16856.diff
Webrev
Link to Webrev Comment