Closed zhaoyao91 closed 4 years ago
Don't do that – you will kill active requests.
See:
Sorry, you won't kill active requests in this case. However, it is possible that the server might still receive requests after receiving the SIGKILL, i.e. you need to allow time to ensure that no more traffic is being routed to your pod instance.
See:
Seems that the delay is a magic number since we don't know how many time it will take to switch iptables.
That is correct.
In the README, I noticed it suggest wait some time before calling
server.close()
. According to the node.js doc, could the following code snippet be better? Or is there some other consideration?