From 4c9bd59ae2b720b46d58bf1fc61e8f067993b5fb Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Mon, 8 Jun 2020 12:42:47 +0200 Subject: [PATCH] Issue #4855 - Occasional h2spec failures on CI More comments after review. Signed-off-by: Simone Bordet --- .../eclipse/jetty/http2/server/HttpTransportOverHTTP2.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java index 925c81dab898..3a59991d93bd 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java @@ -440,11 +440,15 @@ private void postSend() { case PRE_SEND: { + // The send has not completed the callback yet, + // wait for succeeded() or failed() to be called. _state = State.POST_SEND; return; } case SUCCEED: { + // The send already completed successfully, but the + // call to succeeded() was delayed, so call it now. callback = _callback; commit = _commit; failure = null; @@ -453,6 +457,8 @@ private void postSend() } case FAIL: { + // The send already completed with a failure, but + // the call to failed() was delayed, so call it now. _state = State.FAILED; callback = _callback; commit = _commit;