Hi, I am interested in your thoughts and suggestions in implementing a graceful shutdown of a Mina server. Please read below for details.
Hanson Char Implementing Graceful Shutdown ======================== We have a server implemented in Mina 0.8.2, and are thinking of implementing a graceful shutdown of the server upon certain event (such as trapping a SIGINT or SIGTERM). The shutdown basically needs to: 1) stop any new connection from being made, and 2) closes all existing open sessions; For (2), however, I am thinking instead of closing the outstanding open sessions immediately, maybe a better approach would be to wait for the existing write's to finish prior to closing the sessions ? Specifically, for each existing open session, 1) check if it is idle and if so close the session immediately; 2) if not, wait for up to 10 seconds (or whatever timeout parameter), or until it's idle, then close the session; Thoughts ? Suggestions ? Thanks in advance.
