You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can start the server and then issue the following request to it:
GET / HTTP/1.1
connection: keep-alive
keep-alive: timeout=30, max=100
Subsequently, we send SIGINT to the server to indicate we want it to shutdown. At this point, we will see that the server does not shutdown before the keep-alive has completed. Our tests show that new connections are not possible, and re-usage of the existing connection should be met with a 503: https://github.com/fastify/fastify/blob/93fe532986b96ae28a087b2ec385a8abb16cce55/test/close.test.js
Video showing server waitfastify-shutdown.mp4
What we do not seem to have is a forceful termination of those open connections. I recognize that the spec says:
But when we are shutting down, we usually don't want to do that.
I think our fastify.close method is directly mapped to the avvio close method. If we want to support forceful connection draining, would we do it here?:
Given the simple service:
We can start the server and then issue the following request to it:
Subsequently, we send
SIGINTto the server to indicate we want it to shutdown. At this point, we will see that the server does not shutdown before the keep-alive has completed. Our tests show that new connections are not possible, and re-usage of the existing connection should be met with a 503: https://github.com/fastify/fastify/blob/93fe532986b96ae28a087b2ec385a8abb16cce55/test/close.test.jsVideo showing server wait
fastify-shutdown.mp4
What we do not seem to have is a forceful termination of those open connections. I recognize that the spec says:
But when we are shutting down, we usually don't want to do that.
I think our
fastify.closemethod is directly mapped to theavvioclose method. If we want to support forceful connection draining, would we do it here?:fastify/lib/server.js
Lines 177 to 179 in 93fe532