-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetch will always hang up about 4s #2348
Comments
Useful comment: nodejs/node#50188 (comment) |
replace the closes with const closePromisied = promisify(server.close.bind(server)); edit: just saw this was about v18. It seems tangentially related to other v18 issues with idle connections but I can't definitely tell if it's an issue with undici. |
Maybe we can test with the branch? The default keep-alive connections made by |
I think the reason is Closing as this is intended behavior |
Bug Description
Upstream: nodejs/node#50188
Related: nodejs/node#43522, nodejs/node#48383
undici.fetch will still be hanging up even
socket.end
has been called, this will cause the node.js 18 server not to close at the right time.node.js 19/20 won't have this issue because the server will always terminate all socket connections when calling
server.close
Reproducible By
I did some small test code on node.js 20. Comparing
undici.fetch
withnode-fetch
You will see that
Expected Behavior
closePromisied
should finish in within 100msLogs & Screenshots
> git:(main) ✗ node index.cjs server close: 0.193ms server close: 4.001s
Environment
undici >= 4.4.1
Node.js 18.x, 19.x, 20.x
Additional context
The text was updated successfully, but these errors were encountered: