RFR: 8302732: sun/net/www/http/HttpClient/MultiThreadTest.java still failing intermittently [v2]
Daniel Jeliński
djelinski at openjdk.org
Thu Feb 23 15:13:25 UTC 2023
On Thu, 23 Feb 2023 12:35:39 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove unnecessary lock
>
> src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java line 321:
>
>> 319: /* return a still valid, idle HttpClient */
>> 320: HttpClient get() {
>> 321: // check the most recent connection, use if still valid
>
> It might be prudent to assert that the global cacheLock is held by the current thread in get & put (if that's feasible without too much hackery). Just worrying about future maintainers possibly modifying this code and using ClientVector outside of the lock. The assert would make sure they ponder the consequences.
Asserts added; let me know if the amount of hackery involved looks acceptable.
-------------
PR: https://git.openjdk.org/jdk/pull/12676
More information about the net-dev
mailing list