Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Track all HTTP connects and force them closed on server shutdown #2788

Open
davidmurdoch opened this issue Apr 1, 2022 · 3 comments
Open

Comments

@davidmurdoch
Copy link
Member

For clients that connect to the ganache server over HTTP with keepAlive ganache will not immediately close those connections when the server is shutdown, these connections wait until the keepAlive timeout is finished (10 seconds) or until the client sends another request.

See uNetworking/uWebSockets.js#663 and #2667

This isn't just a uWS issue, node core also requires this pattern: nodejs/node#2642

@MicaiahReid
Copy link
Contributor

@davidmurdoch, can you clarify on the below?

these connections wait until the keepAlive timeout is finished (10 seconds) or until the client sends another request.

Are you saying that if the client sends another request, the keepAlive timeout will start over, and this will hole open the connection? @cds-amal and I are looking into another issue with Ganache not shutting down and are wondering if this is the cause.

@davidmurdoch
Copy link
Member Author

As of #2667 Ganache will close the connection if another request is sent within the keepAlive window. What I'm am saying above is that we don't proactively close the keep alive connection (we wait for it to timeout or for another request to come in over the connection in order to close it).

@LuKks
Copy link

LuKks commented Jan 24, 2023

In case it's useful: https://github.com/LuKks/graceful-http

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Backlog
Development

No branches or pull requests

4 participants