JDK-6782751 : HttpsClient.putInKeepAliveCache() does not grant HttpClient.inCache changed
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2008-12-09
  • Updated: 2022-03-15
  • Resolved: 2022-03-15
Related Reports
Duplicate :  
Relates :  
Description
Yes, there is certainly a bug here. 

Thanks,
-Chris.

Xuelei Fan wrote:
> Hi Chris,
>
> I need help on a HttpsClient method.
>
> The HttpClient.putInKeepAliveCache() will change the HttpClient.inCache value, and which will have effect on KeepAliveStreamCleaner via HttpClient.isInKeepAliveCache().
>
> However, the HttpsClient.putInKeepAliveCache() will not change the HttpClient.inCache value, so I think it would be a potential issue of KeepAliveStreamCleaner.
>
> I would submit a bug if you agree that the HttpsClient.putInKeepAliveCache() break the behaviors of KeepAliveStreamCleaner.
>
> Thanks,
> Andrew

Comments
Marking this as a duplicate of https://bugs.openjdk.java.net/browse/JDK-8009251
15-03-2022

Looking at the latest code in master branch (JDK 19), it appears that this issue is no longer relevant since the "inCache" field does get updated in sun.net.www.protocol.https.HttpsClient#putInKeepAliveCache(). Looking at the commit history, that fix seems have been done as part of https://bugs.openjdk.java.net/browse/JDK-8009251. Having said that, the current implementation of HttpsClient#putInKeepAliveCache(), I think might have a bug wherein it doesn't acquire a lock while updating this "inCache" value unlike the implementation of this method in HttpClient class. I'll open a separate JBS issue to track that. This current one I think could be closed as outdated, if my analysis of the code appears accurate.
03-03-2022

Looks like this got filed in the wrong component.
16-02-2022