On Mon, 24 Oct 2022 17:28:10 GMT, Daniel Fuchs <dfu...@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

Reply via email to