Ensure exit is possible
If shutdown has been initiated (via maxadmin or by sending a SIGINT or SIGTERM) and a SIGTERM is received, the process is terminated. If shutdown has been initiated (via maxadmin or by sending a SIGINT or SIGTERM) and a SIGINT (Ctrl-C) is received, a warning is printed that shutdown is in progess. Then, if an additional SIGINT is received, the process is terminated. So, in practice: - If MaxScale is running as a daemon, the first SIGTERM initiates shutdown and a second one unconditionally terminates the process. - If MaxScale is running in the console, the first Ctrl-C initiates shutdown, the second prints a warning and the third terminates the process. This is to ensure that MaxScale can be forced to exit, in case some thread is hung for whatever reason, and is thus preventing the controlled shutdown.
This commit is contained in:
@ -44,4 +44,14 @@ void maxscale_reset_starttime(void);
|
||||
time_t maxscale_started(void);
|
||||
int maxscale_uptime(void);
|
||||
|
||||
/**
|
||||
* Initiate shutdown of MaxScale.
|
||||
*
|
||||
* This functions informs all threads that they should stop the
|
||||
* processing and exit.
|
||||
*
|
||||
* @return How many times maxscale_shutdown() has been called.
|
||||
*/
|
||||
int maxscale_shutdown(void);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
Reference in New Issue
Block a user