diff --git a/jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/HttpChannelState.java b/jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/HttpChannelState.java index 17b1bf62688..5e749f09cab 100644 --- a/jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/HttpChannelState.java +++ b/jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/HttpChannelState.java @@ -354,7 +354,6 @@ public class HttpChannelState */ Boolean abort(Throwable failure) { - boolean handle; try (AutoLock ignored = lock()) { boolean aborted = abortResponse(failure); @@ -362,9 +361,13 @@ public class HttpChannelState LOG.debug("abort={} {}", aborted, this, failure); if (aborted) { - handle = _state == State.WAITING; + boolean handle = _state == State.WAITING; if (handle) _state = State.WOKEN; + // XXX changing the RequestState to COMPLETED *and* returning true here + // means completed(Throwable failure) will be called by the redispatching + // and the latter will throw on its _requestState check as it wants it + // to be COMPLETING. _requestState = RequestState.COMPLETED; return handle; } @@ -1022,7 +1025,7 @@ public class HttpChannelState LOG.debug("completed {}", toStringLocked()); if (_requestState != RequestState.COMPLETING) - throw new IllegalStateException(this.getStatusStringLocked()); + return; // Already completed, possibly by abort(). if (_event == null) {