Skip to content

Commit

Permalink
Fix #9169 refine idle timeout and failure
Browse files Browse the repository at this point in the history
Only fail request callback if a failure has not been otherwise notified.
Slight optimization for failing idle timeouts by avoiding double lock.
Always create a failure if failing the callback.
  • Loading branch information
gregw committed Aug 28, 2023
1 parent a746c04 commit e91619f
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,12 @@ public Runnable onIdleTimeout(TimeoutException t)
});
}

// otherwise, we are going to fail the callback, either directly or by a call to onFailure, so ensure all future IO
// operations are failed as well
_failure = Content.Chunk.from(t, true);

// if there is no failure listener, then we can fail the callback directly without a double lock
// otherwise, if there is no failure listener, then we can fail the callback directly without a double lock
if (_onFailure == null && _request != null)
{
_failure = Content.Chunk.from(t, true);
return () -> _request._callback.failed(t);
}
}
}

Expand Down

0 comments on commit e91619f

Please sign in to comment.