AbortSignal.timeout inner exception should be DISCONNECTED - #1177
Merged
Conversation
kentonv
reviewed
Sep 13, 2023
Fixes: #1020 Previously, `AbortSignal.timeout()` would cause the `AbortSignal` to trigger with an exception not marked as `DISCONNECTED`. This would mean that when the signal is used to cancel, for instance, a fetch POST, the exception passed on via the internal canceler would end up being logged as an uncaught exception as reported in the github issue. This commit updates things such that AbortSignal.timeout properly reports a `DISCONNETED` kj::Exception when the timeout fires.
jasnell
force-pushed
the
jsnell/abortsignal-timeout-disconnected
branch
from
October 3, 2023 16:51
f6d1b37 to
7a28ec6
Compare
ohodson
approved these changes
Oct 3, 2023
5 tasks
This was referenced Apr 19, 2026
7 tasks
This was referenced Jul 1, 2026
This was referenced Jul 16, 2026
This was referenced Aug 1, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #1020
Previously,
AbortSignal.timeout()would cause theAbortSignalto trigger with an exception not marked asDISCONNECTED. This would mean that when the signal is used to cancel, for instance, a fetch POST, the exception passed on via the internal canceler would end up being logged as an uncaught exception as reported in the github issue. This commit updates things such that AbortSignal.timeout properly reports aDISCONNECTEDkj::Exception when the timeout fires. It also makes that path slightly more efficient by avoiding an extraneous kj::Exception->JS exception->kj::Exception round trip.