[10] RFR: 8177935: java/net/httpclient/http2/FixedThreadPoolTest.java fails frequently

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[10] RFR: 8177935: java/net/httpclient/http2/FixedThreadPoolTest.java fails frequently

Daniel Fuchs
Hi,

Please find a small fix for:

8177935: java/net/httpclient/http2/FixedThreadPoolTest.java fails frequently
https://bugs.openjdk.java.net/browse/JDK-8177935

webrev:
http://cr.openjdk.java.net/~dfuchs/webrev_8177935/webrev/

The "Should not happen" exception happens because of a race condition
in AsyncWriteQueue which may occur between consumeAction.accept(...)
and state.get() (between lines 159 and 160 in the original file).

There is a small window of opportunity here, where the
WriteEvent registered by consumeAction.accept() may already
have been triggered and entered the flushLoop() and switched
the state to FLUSHING before the already running flushLoop()
had a chance to observe the DELAYED state and running.
This will cause two flushLoop() to run concurrently in the
critical section, and this can cause anything to happen.

The solution is to change the consumeAction() to return a boolean
(false) if it wasn't able to flush all the data.

best regards,

-- daniel
Reply | Threaded
Open this post in threaded view
|

Re: [10] RFR: 8177935: java/net/httpclient/http2/FixedThreadPoolTest.java fails frequently

Chris Hegarty

> On 16 Aug 2017, at 17:08, Daniel Fuchs <[hidden email]> wrote:
>
> Hi,
>
> Please find a small fix for:
>
> 8177935: java/net/httpclient/http2/FixedThreadPoolTest.java fails frequently
> https://bugs.openjdk.java.net/browse/JDK-8177935
>
> webrev:
> http://cr.openjdk.java.net/~dfuchs/webrev_8177935/webrev/

This looks good to me Daniel.

-Chris.