Skip to content

[java] JdkHttpClient - Close all websockets before shutting down the executor #12035

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

Merged
merged 2 commits into from
May 15, 2023

Conversation

joerg1985
Copy link
Member

Description

This PR will change the following things:

  • Close all websockets not only the last created
  • Close the websockets before shutting down the executor, to avoid JDK-8277969
  • close() can be called multiple times, like the javadoc of Closeable is demanding

Motivation and Context

Should help with #11868

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR!

I think this makes sense. But I do not understand how we are closing the underlyingSocket one, or how the close method is actually closing it. Probably I am missing something.

@joerg1985
Copy link
Member Author

@diemol sending the close message initiates an orderly closure of the websocket.
from the javadoc: The sendClose method does not close this WebSocket's input. It merely closes this WebSocket's output by sending a Close message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants