RFR: 8286194: ExecutorShutdown test fails intermittently [v2]

Daniel Fuchs dfuchs at openjdk.java.net
Fri May 6 09:38:38 UTC 2022


> Hi, please find here a patch that solves a rare intermittent test failure observed in the test `java/net/httpclient/ExecutorShutdown.java`
> 
> A race condition coupled with some too eager synchronization was causing a deadlock between an Http2Connection close, a thread trying to shutdown the HttpClient due to a RejectedTaskException, and the SelectorManager thread trying to exit.
> 
> The fix comprises several cleanup - in particular:
> 
> - `Http2Connection`: no need to try to send a `GOAWAY` frame if the underlying TCP connection is already closed
> - `SSLFlowDelegate`/`SubscriberWrapper`: no need to trigger code that will request more data from upstream if the sequential scheduler that is supposed to handle that data once it arrives is already closed
> - `Http1Exchange`/`Http1Request`: proper cancellation of subscription if an exception is raised before `onSubscribe()` has been called
> - `HttpClientImpl`: avoid calling callbacks from within synchronized blocks when not necessary
> - `ReferenceTracker`: better thread dumps in case where the selector is still alive at the end of the test (remove the limit that limited the stack traces to 8 element max by no longer relying on `ThreadInfo::toString`)

Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:

  Added a comment to ReferenceTracker.java as suggested in the review

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8562/files
  - new: https://git.openjdk.java.net/jdk/pull/8562/files/0a674cef..ce8ad93d

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8562&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8562&range=00-01

  Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8562.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8562/head:pull/8562

PR: https://git.openjdk.java.net/jdk/pull/8562



More information about the security-dev mailing list