RFR: 8288717: Add a means to close idle connections in HTTP/2 connection pool [v4]
Conor Cleary
ccleary at openjdk.org
Tue Oct 25 13:33:56 UTC 2022
On Mon, 24 Oct 2022 17:28:10 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Conor Cleary has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8288717: Updated test and property to use seconds
>
> src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java line 736:
>
>> 734: }
>> 735: if (Log.errors()) {
>> 736: if (idleConnectionTimeoutEvent != null && idleConnectionTimeoutEvent.isFired()) {
>
> The reference for idleConnectionTimeoutEvent should be captured in the synchronized block above.
>
>
> IdleConnectionTimeoutEvent idleConnectionTimeoutEvent;
> synchronized (this) {
> if (closed == true) return;
> closed = true;
> idleConnectionTimeoutEvent = this.idleConnectionTimeoutEvent;
> }
> if (Log.errors()) {
> if (idleConnectionTimeoutEvent != null && idleConnectionTimeoutEvent.isFired()) { ... }
And also, the check for Log.errors() could be ignored. Thinking that if the developer is configuring this property, the error should always be shown if the timeout occurs for clarity. An additional check for the correct exception type might be nice too in case the idleConnectionTimeoutEvent log is incorrectly logged when the event is not null _and_ has been fired. An unlikely case but worth catching perhaps.
-------------
PR: https://git.openjdk.org/jdk/pull/10183
More information about the net-dev
mailing list