Skip to content

Commit

Permalink
Issue #4855 - Occasional h2spec failures on CI
Browse files Browse the repository at this point in the history
In case of a call to `AsyncListener.onError()`, applications may decide to call
AsyncContext.complete() and that would be a correct usage of the Servlet API.

This case was not well handled and was wrongly producing a WARN log with an
`IllegalStateException`.

Signed-off-by: Simone Bordet <[email protected]>
  • Loading branch information
sbordet committed Jun 5, 2020
1 parent fd053aa commit 9dec284
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,16 @@ protected void onError(Throwable th)
{
// If we are still async and nobody has called sendError
if (_requestState == RequestState.ASYNC && !_sendError)
{
// Then the listeners did not invoke API methods
// and the container must provide a default error dispatch.
sendError(th);
else
}
// Otherwise the listeners have called AsyncContext.complete().
else if (_requestState != RequestState.COMPLETE)
{
LOG.warn("unhandled in state " + _requestState, new IllegalStateException(th));
}
}
}

Expand Down

0 comments on commit 9dec284

Please sign in to comment.