[jdk8u-dev] RFR: 8293562: KeepAliveCache Blocks Threads while Closing Connections [v3]
Dhamoder Nalla
dhanalla at openjdk.org
Wed Feb 14 22:40:04 UTC 2024
On Fri, 9 Feb 2024 09:59:43 GMT, Andrew Haley <aph at openjdk.org> wrote:
> I'm surprised you think this is suitable for 8u. It's not low risk, and it's more of a performance fix than a bug, and it's P4. JDK 8u is done. It's a long-term maintenance release.
Thanks for reviewing this PR @theRealAph ,
I understand that this is not a Low-risk. We've observed that two of our valued customers' applications, which heavily rely on HttpClient and handle thousands of requests per second, encounter significant challenges with TLS 1.3. Specifically, these applications become almost unresponsive due to a huge number of blocked threads (The same issue is explained here https://techcommunity.microsoft.com/t5/azure-storage-blog/prepare-for-upcoming-tls-1-3-support-for-azure-storage/ba-p/4034014) Unfortunately, due to various constraints, these customers are unable to upgrade to the later JDK version or revert to TLS 1.2. Both of these customers have explicitly conveyed that implementing this fix would greatly alleviate their current roadblocks.
The attached test simulates a scenario in which the second HTTP client read request fails with a timeout as it is blocked by the first socket close connection. This blocking occurs due to synchronization locks in the KeepAliveCache's put and Keep-Alive-Timer thread methods, with the Keep-Alive-Timer thread handling socket closure while holding a lock. This means that while it's closing connections, no other connections can be established, retrieved from the cache, or added to the cache. And the test passes with the fix.
-------------
PR Comment: https://git.openjdk.org/jdk8u-dev/pull/409#issuecomment-1944862767
More information about the jdk8u-dev
mailing list