Open davidmurdoch opened 2 years ago
@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.
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).
In case it's useful: https://github.com/LuKks/graceful-http
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 https://github.com/uNetworking/uWebSockets.js/issues/663 and https://github.com/trufflesuite/ganache/pull/2667
This isn't just a uWS issue, node core also requires this pattern: https://github.com/nodejs/node/issues/2642