Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Race condition #5358

Closed
dtbaum opened this issue Jul 7, 2023 · 1 comment · Fixed by #5359
Closed

Race condition #5358

dtbaum opened this issue Jul 7, 2023 · 1 comment · Fixed by #5359

Comments

@dtbaum
Copy link
Contributor

dtbaum commented Jul 7, 2023

When the first GET request is in progress, all parallel requests from other Jersey clients, in other threads, fail with SSLHandshakeException: PKIX path building failed.
Once the first GET request is completed, all subsequent requests work without error.
Here is the code which demonstrates this issue:
https://github.com/dtbaum/jersey-bug-report

The fix in HttpUrlConnector.java solved the issue, see pull request #5359.
Affected versions: at least 3.1.2 & OpenJDK17 and 2.37 & OpenJDK 8

dtbaum added a commit to dtbaum/jersey that referenced this issue Jul 7, 2023
Fix for the race condition:
eclipse-ee4j#5358
dtbaum added a commit to dtbaum/jersey that referenced this issue Jul 7, 2023
Fixed race condition, see:
 eclipse-ee4j#5358
@dtbaum dtbaum mentioned this issue Jul 7, 2023
@jansupol jansupol linked a pull request Oct 11, 2023 that will close this issue
@fwippe
Copy link

fwippe commented Sep 10, 2024

@senivam @jansupol @dtbaum Please note that this change has been having a drastic impact on performance, in particular when using Jersey client for multiple services: Only one connection can be created at a time, across all routes. If the intention had been to just synchronize HttpsURLConnection.getDefaultSSLSocketFactory(), as an alternative you could have introduced a lazy one-off supplier initializing the socket factory. What do you think?

See #5738 for performance impact in practice.

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

Successfully merging a pull request may close this issue.

2 participants