diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-20 16:11:07 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-22 10:57:29 +0100 |
commit | 390620fc357bfdb9e7f20835e3c61e857e3a5da2 (patch) | |
tree | c76cc7c463595da8053501c78d7f1db61e0985a1 /src/libserver/worker_util.h | |
parent | eafdd221037b41ddcba0add79fd8efccecaf0775 (diff) | |
download | rspamd-390620fc357bfdb9e7f20835e3c61e857e3a5da2.tar.gz rspamd-390620fc357bfdb9e7f20835e3c61e857e3a5da2.zip |
[Rework] Rework children operations
Diffstat (limited to 'src/libserver/worker_util.h')
-rw-r--r-- | src/libserver/worker_util.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libserver/worker_util.h b/src/libserver/worker_util.h index 9693aa6ad..4946badcf 100644 --- a/src/libserver/worker_util.h +++ b/src/libserver/worker_util.h @@ -186,7 +186,9 @@ void rspamd_worker_session_cache_remove (void *cache, void *ptr); * Fork new worker with the specified configuration */ struct rspamd_worker *rspamd_fork_worker (struct rspamd_main *, - struct rspamd_worker_conf *, guint idx, struct ev_loop *ev_base); + struct rspamd_worker_conf *, guint idx, + struct ev_loop *ev_base, + rspamd_worker_term_cb term_handler); /** * Sets crash signals handlers if compiled with libunwind @@ -210,6 +212,17 @@ void rspamd_worker_init_monitored (struct rspamd_worker *worker, */ void rspamd_worker_throttle_accept_events (gint sock, void *data); +/** + * Checks (and logs) the worker's termination status. Returns TRUE if a worker + * should be restarted. + * @param rspamd_main + * @param wrk + * @param status waitpid res + * @return TRUE if refork is desired + */ +gboolean rspamd_check_termination_clause (struct rspamd_main *rspamd_main, + struct rspamd_worker *wrk, int status); + #define msg_err_main(...) rspamd_default_log_function (G_LOG_LEVEL_CRITICAL, \ rspamd_main->server_pool->tag.tagname, rspamd_main->server_pool->tag.uid, \ G_STRFUNC, \ |