Skip to content

fix: remove abort event listener on successful completion in fetchWithTimeout#1812

Open
jordanjennings wants to merge 1 commit intoopenai:masterfrom
jordanjennings:fix/1811-remove-abort-listener-on-completion
Open

fix: remove abort event listener on successful completion in fetchWithTimeout#1812
jordanjennings wants to merge 1 commit intoopenai:masterfrom
jordanjennings:fix/1811-remove-abort-listener-on-completion

Conversation

@jordanjennings
Copy link
Copy Markdown

When an AbortSignal is passed to fetchWithTimeout, the method adds an event listener to forward abort events to the internal controller but never removes it on successful completion. In Deno, this refs the underlying timer of AbortSignal.timeout(), preventing the process from exiting until the full timeout duration elapses.

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

  • Clean up signal event listener when fetch finishes

Additional context & links

Fixes #1811

@jordanjennings jordanjennings requested a review from a team as a code owner April 3, 2026 20:03
…hTimeout

When an AbortSignal is passed to fetchWithTimeout, the method adds an
event listener to forward abort events to the internal controller but
never removes it on successful completion. In Deno, this refs the
underlying timer of AbortSignal.timeout(), preventing the process from
exiting until the full timeout duration elapses.

Fixes openai#1811
@jordanjennings jordanjennings force-pushed the fix/1811-remove-abort-listener-on-completion branch from 9960bba to a0bac18 Compare April 13, 2026 14:50
@jordanjennings
Copy link
Copy Markdown
Author

Didn't intend to close this PR, reopening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetchWithTimeout does not remove abort event listener on successful completion, preventing process exit on Deno

1 participant