Question: in Mina 0.8.2, does Session.close(true);
waits for all outstanding asyn write operations to complete before closing the session ? If so, maybe I can wrap the invocation of each session.close(true); within the execution of a thread that has a timeout if, and only if, timeout happens, invoke session.close(); It would be nice if there was a method like Session.close(int timeout); which waits for the close to finish up to the timeout limit. Hanson On 8/5/06, Hanson Char <[EMAIL PROTECTED]> wrote:
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.
