#12520 identification of the bug + naive (and partially wrong) fix

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2024-11-18 14:32:41 +01:00
parent dd31feb034
commit d6abf806dc
No known key found for this signature in database
GPG Key ID: 3D146A4A1C58367E
1 changed files with 6 additions and 3 deletions

View File

@ -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)
{