You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This calls abort on the request, and fires the callback. So you'd expect simpleGet to have relinquished all execution back to the caller.
But in a super simple example of simply making a request to some URL, and exiting (nothing more), there is an observed 30s delay between when the callback is called with the error and before the process exits.
I looked into it, and it appears this is caused by the fact that the http module from node defaults to dns.lookup which is not cancellable.
I experimented with swapping this out with Tangerine which maintains an internal AbortController and adding a tangerine.cancel() on any error and it worked flawlessly.
Slight hiccup though - tangerine's peer dependency is undici so it might be unfortunate to pull that in if you're not using it. Ref: #64
But there's other DNS alternatives that don't require undici. Up to you, just figured I'd mention this here.
The text was updated successfully, but these errors were encountered:
simple-get/index.js
Lines 74 to 77 in e7a7411
This calls
abort
on the request, and fires the callback. So you'd expectsimpleGet
to have relinquished all execution back to the caller.But in a super simple example of simply making a request to some URL, and exiting (nothing more), there is an observed 30s delay between when the callback is called with the error and before the process exits.
I looked into it, and it appears this is caused by the fact that the
http
module from node defaults todns.lookup
which is not cancellable.I experimented with swapping this out with
Tangerine
which maintains an internalAbortController
and adding atangerine.cancel()
on any error and it worked flawlessly.Slight hiccup though - tangerine's peer dependency is
undici
so it might be unfortunate to pull that in if you're not using it. Ref: #64But there's other DNS alternatives that don't require undici. Up to you, just figured I'd mention this here.
The text was updated successfully, but these errors were encountered: