-
Notifications
You must be signed in to change notification settings - Fork 900
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Clear fetch abort timeout #8663
Conversation
🦋 Changeset detectedLatest commit: 02b9fc3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with one minor nit.
We set a timeout to abort a request after 180s by default, but we don't cancel this timeout after the request completes. We should cancel this timeout after the request completes to prevent Node scripts from hanging.
I inlined everything in
buildFetchOptions
and removed that function. Let me know if I should revert this and initialize theAbortController
in there- but I think the timeout-related code still has to be inlined so that we can get thetimeoutId
.I tested this in a Node script using the default timeout and a custom timeout, and they both work as expected. If the timeout is triggered before the request completes, an
AbortError
is thrown. If the request completes before the timeout is triggered, the timeout is cancelled, and the Node script is able to exit.Fixes b/380936830 (internal)