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

Daniel Fuchs daniel.fuchs at oracle.com
Wed Aug 16 16:08:40 UTC 2017


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


More information about the net-dev mailing list