Closed stefan-guggisberg closed 4 years ago
When the body of the response is consumed the process exits as expected, i.e. the following works:
const { fetch, disconnectAll } = require('fetch-h2');
(async function () {
const resp = await fetch('https://httpbin.org/status/200');
await resp.arrayBuffer();
await disconnectAll();
}());
Note that this only applies to HTTP1 requests. HTTP2 requests don't seem to have this problem.
:tada: This issue has been resolved in version 2.4.3 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
When making an Http1 request followed by
disconnectAll()
the process doesn't exit.When running the following snippet the process hangs, i.e. node doesn't exit. It seems like
disconnectAll()
doesn'tunref
the socket.OTOH, when making an Http2 request, the process exits as expected: