On Wed, 31 May 2023 16:52:02 GMT, Daniel Fuchs <[email protected]> wrote:
> The ExecutorShutdown test has been observed failing intermittently, notably
> if by misfortune the shutdown sequence causes a connection to get aborted
> while upgrading. The issue is that the `ConnectionAborter` class that allows
> to mark the connection as being scheduled for closing before a handle to the
> connection is actually available isn't forwarding the original exception for
> which closing the connection was requested. When the connection is eventually
> closed, a generic `IOException: connection closed locally` is raised at the
> `SocketTube` level, which unfortunately can race with the original cause.
>
> The fix makes it possible to relay the original cause to the place where the
> IOException is raised, in order to set it as the cause of the new exception.
src/java.net.http/share/classes/jdk/internal/net/http/Exchange.java line 167:
> 165: Throwable cause;
> 166: synchronized (this) {
> 167: if ((cause = this.cause) == null) {
let's extract the assignment to a separate statement. Code is a bit hard to
read.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14251#discussion_r1212154837