Boards / Async · 312 views

AbortController vs a hanging fetch

Opened Sep 10, 2026 by Ned Cole. One vote per account. No vote on your own post.

op +4

Ned Cole · Sep 10, 2026 20:11

I pass signal into fetch. The server never answers. abort() after 8s rejects, but the socket still shows in the network panel as pending for another minute. Is that the browser keeping the request, or did I forget to abort a second fetch I chained in then()?

+11 best

Lia Kemp · Sep 10, 2026 20:48

You aborted the first call. The then() started a second fetch with no signal. Pass the same controller.signal into both, or abort before you chain. The pending line is that second request. DevTools will keep it until the server or the tab dies.

+2

Bo Reed · Sep 10, 2026 21:20

If you wrap fetch in a timeout helper, return both the promise and the controller. I used to hide the controller and then could not abort the follow-up.

+1

Wren Hale · Sep 11, 2026 07:02

Same pattern on Node 20 undici. AbortError is not a TypeError — catch by name if you retry.