RFR: 8293562: blocked threads with KeepAliveCache.get [v5]
Daniel Jeliński
djelinski at openjdk.org
Fri Sep 30 11:31:30 UTC 2022
On Fri, 30 Sep 2022 10:40:28 GMT, Michael McMahon <michaelm at openjdk.org> wrote:
>> Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Describe oldClient
>
> src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java line 330:
>
>> 328: long currentTime = System.currentTimeMillis();
>> 329: KeepAliveEntry e = peekFirst();
>> 330: if ((currentTime - e.idleStartTime) > nap) {
>
> Since `peekFirst` can return null in theory, should we check for it? Currently `pop` is used which throws an exception instead, and probably means it doesn't happen in practice, but maybe it could be flagged in static source code analysis?
good point. Also it allows us to drop the `isEmpty` check.
-------------
PR: https://git.openjdk.org/jdk/pull/10401
More information about the net-dev
mailing list