undici
undici copied to clipboard
spec doesn't finalize connection on network error
I've been reading through the spec a few times now and there seems to be missing a connection cleanup somewhere.
The problem is that whenever we replace response
with a network error
(example) that means that we no longer will read that response nor do we close the associated connection. Effectively leaking the connection.
Is this a bug in the spec or am I missing something? Maybe we need a "terminate" in fetch finale
?
@szmarczak @annevk
https://github.com/nodejs/undici/commit/42b67e12b3b62a47789b7bf6ea4a64be8d8a9f25
Or maybe the spec assumes that GC should handle this? https://github.com/nodejs/undici/pull/950
Indeed. I believe the connection should be terminated.