Skip to content

Commit

Permalink
Transient timeouts. Fixes #10234 and #10277
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed Nov 1, 2023
1 parent 4be8b24 commit 18c25bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,7 @@ protected Action process() throws Throwable
return Action.SCHEDULED;

if (Content.Chunk.isFailure(current))
{
if (current.isLast())
throw current.getFailure();
if (LOG.isDebugEnabled())
LOG.debug("ignored transient failure", current.getFailure());
succeeded();
return Action.SCHEDULED;
}
throw current.getFailure();

sink.write(current.isLast(), current.getByteBuffer(), this);
return Action.SCHEDULED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,10 @@ public Runnable onIdleTimeout(TimeoutException t)
Runnable invokeWriteFailure = _response.lockedFailWrite(t);

// If demand was in process, then arrange for the next read to return the idle timeout, if no other error
// TODO to make IO timeouts transient, remove the invokeWriteFailure test below.
// Probably writes cannot be made transient as it will be unclear how much of the buffer has actually
// been written. So write timeouts might always be persistent... but then we should call the listener
// before calling lockedFailedWrite above.
if (invokeOnContentAvailable != null || invokeWriteFailure != null)
if (invokeOnContentAvailable != null)
{
// TODO The chunk here should be last==false, so that IO timeout is a transient failure.
// However AsyncContentProducer has been written on the assumption of no transient
// failures, so it needs to be updated before we can make timeouts transients.
// See ServerTimeoutTest.testAsyncReadHttpIdleTimeoutOverridesIdleTimeout
_failure = Content.Chunk.from(t, true);
_failure = Content.Chunk.from(t, false);
System.err.println("failure chunk " + _failure);
}

// If there was an IO operation, just deliver the idle timeout via them
Expand Down

0 comments on commit 18c25bd

Please sign in to comment.