while (g_hash_table_iter_next (&it, &k, &v)) {
wrk = v;
+ /* No control pipe */
if (wrk->control_pipe[0] == -1) {
continue;
}
continue;
}
+ /* Worker is terminating, do not bother sending stuff */
+ if (wrk->state == rspamd_worker_state_terminating) {
+ continue;
+ }
+
memset (&msg, 0, sizeof (msg));
/* Attach fd to the message */
w->state = rspamd_worker_state_terminating;
kill (w->pid, SIGUSR2);
ev_io_stop (rspamd_main->event_loop, &w->srv_ev);
+ g_hash_table_remove_all (w->control_events_pending);
msg_info_main ("send signal to worker %P", w->pid);
}
else {
/* Remove dead child form children list */
g_hash_table_remove (rspamd_main->workers, GSIZE_TO_POINTER (wrk->pid));
+ g_hash_table_remove_all (wrk->control_events_pending);
+
if (wrk->srv_pipe[0] != -1) {
/* Ugly workaround */
if (wrk->tmp_data) {