return NULL;
}
-sig_atomic_t wanna_die = 0;
-
static void
rspamd_worker_terminate_handlers (struct rspamd_worker *w)
{
/* Do not accept new connections, preparing to end worker's process */
struct timeval tv;
- if (!wanna_die) {
+ if (!sigh->worker->wanna_die) {
tv.tv_sec = SOFT_SHUTDOWN_TIME;
tv.tv_usec = 0;
- wanna_die = 1;
+ sigh->worker->wanna_die = TRUE;
rspamd_worker_terminate_handlers (sigh->worker);
rspamd_default_log_function (G_LOG_LEVEL_INFO,
sigh->worker->srv->server_pool->tag.tagname,
{
struct timeval tv;
- if (!wanna_die) {
+ if (!sigh->worker->wanna_die) {
rspamd_default_log_function (G_LOG_LEVEL_INFO,
sigh->worker->srv->server_pool->tag.tagname,
sigh->worker->srv->server_pool->tag.uid,
"terminating after receiving signal %s",
g_strsignal (sigh->signo));
rspamd_worker_terminate_handlers (sigh->worker);
- wanna_die = 1;
+ sigh->worker->wanna_die = 1;
tv.tv_sec = 0;
tv.tv_usec = 0;
pid_t pid; /**< pid of worker */
guint index; /**< index number */
guint nconns; /**< current connections count */
+ gboolean wanna_die; /**< worker is terminating */
gdouble start_time; /**< start time */
struct rspamd_main *srv; /**< pointer to server structure */
GQuark type; /**< process type */