diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-16 12:45:27 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-16 14:17:23 +0100 |
commit | 87f4dd3154e84586ca0541481c45b8d9edd1e865 (patch) | |
tree | 37bf4f4d7b1211e3b5be55a1aaabc5fb73875ef4 /src | |
parent | d3c4960c71829c2c6694297a92e688a1ae5e16e4 (diff) | |
download | rspamd-87f4dd3154e84586ca0541481c45b8d9edd1e865.tar.gz rspamd-87f4dd3154e84586ca0541481c45b8d9edd1e865.zip |
[Minor] Improve crash logging
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/worker_util.c | 1 | ||||
-rw-r--r-- | src/rspamd.c | 13 | ||||
-rw-r--r-- | src/rspamd.h | 1 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c index cdd98ded5..a0e511929 100644 --- a/src/libserver/worker_util.c +++ b/src/libserver/worker_util.c @@ -601,6 +601,7 @@ rspamd_fork_worker (struct rspamd_main *rspamd_main, wrk->finish_actions = g_ptr_array_new (); wrk->ppid = getpid (); wrk->pid = fork (); + wrk->cores_throttled = rspamd_main->cores_throttling; switch (wrk->pid) { case 0: diff --git a/src/rspamd.c b/src/rspamd.c index fdc9b1b49..4cf9ff287 100644 --- a/src/rspamd.c +++ b/src/rspamd.c @@ -1028,12 +1028,19 @@ rspamd_cld_handler (gint signo, short what, gpointer arg) g_strsignal (WTERMSIG (res))); } else { + struct rlimit rlmt; + (void)getrlimit (RLIMIT_CORE, &rlmt); + msg_warn_main ( "%s process %P terminated abnormally by signal: %s" - " but NOT created core file", + " but NOT created core file (throttled=%s); " + "core file limits: %L current, %L max", g_quark_to_string (cur->type), cur->pid, - g_strsignal (WTERMSIG (res))); + g_strsignal (WTERMSIG (res)), + cur->cores_throttled ? "yes" : "no", + (gint64)rlmt.rlim_cur, + (gint64)rlmt.rlim_max); } #else msg_warn_main ( @@ -1063,6 +1070,8 @@ rspamd_cld_handler (gint signo, short what, gpointer arg) if (need_refork) { /* Fork another worker in replace of dead one */ rspamd_check_core_limits (rspamd_main); + + rspamd_fork_delayed (cur->cf, cur->index, rspamd_main); } } diff --git a/src/rspamd.h b/src/rspamd.h index 409c051b3..c6d4c209f 100644 --- a/src/rspamd.h +++ b/src/rspamd.h @@ -72,6 +72,7 @@ struct rspamd_worker { guint index; /**< index number */ guint nconns; /**< current connections count */ gboolean wanna_die; /**< worker is terminating */ + gboolean cores_throttled; /**< set to true if cores throttling took place */ gdouble start_time; /**< start time */ struct rspamd_main *srv; /**< pointer to server structure */ GQuark type; /**< process type */ |