-
Notifications
You must be signed in to change notification settings - Fork 602
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
Fully read heartbeat stream in RESTMBeanServerConnection #30746
Conversation
The server response to the heartbeat/notification request is the class name string 'com.ibm.ws.kernel.boot.jmx.internal.PlatformMBeanServer'. This needs to be read, and the stream closed, to allow the HTTPURLConnection to be properly pooled/reused. Not reading the stream was causing dangling sockets in close_wait state
#build (view Open Liberty Personal Build - ❌ completed with errors/failures.) Note: Target locations of links might be accessible only to IBM employees. |
Code analysis and actionsDO NOT DELETE THIS COMMENT.
|
Your personal build request is at https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_Yo5igefaEe-iabY-3Iflhw Target locations of links might be accessible only to IBM employees. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@idlewis Thanks for the PR. Just one clarification about the while
loop.
// Server sends a string back that needs to be consumed to close the connection | ||
InputStream is = connection.getInputStream(); | ||
int data = is.read(); | ||
while (data != -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to make sure that it won't get stuck here indefinitely. Otherwise, a maximum retry may need to be set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@idlewis Adding approval in case the above inquiry is not a real concern and you want to go ahead and merge.
#build (view Open Liberty Personal Build - ❌ completed with errors/failures.) Note: Target locations of links might be accessible only to IBM employees. |
Code analysis and actionsDO NOT DELETE THIS COMMENT.
|
I'm happy that the read loop for the stream is okay. This is how we consume the input streams in other parts of the JMX client |
Your personal build request is at https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_QsNOIOidEe-iabY-3Iflhw Target locations of links might be accessible only to IBM employees. |
#build (view Open Liberty Personal Build - ❌ completed with errors/failures.) Note: Target locations of links might be accessible only to IBM employees. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve the change in the second commit which uses a try-with-resources.
Code analysis and actionsDO NOT DELETE THIS COMMENT.
|
Your personal build request is at https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_rIHy4Op3Ee-iabY-3Iflhw Target locations of links might be accessible only to IBM employees. |
The server response to the heartbeat/notification request is the class name string 'com.ibm.ws.kernel.boot.jmx.internal.PlatformMBeanServer'. This needs to be read, and the stream closed, to allow the HTTPURLConnection to be properly pooled/reused. Not reading the stream was causing dangling sockets in close_wait state
fixes #30758
release bug
label if applicable: https://github.com/OpenLiberty/open-liberty/wiki/Open-Liberty-Conventions).