Browse Source

[Minor] Improve crash logging

tags/1.8.1
Vsevolod Stakhov 5 years ago
parent
commit
87f4dd3154
3 changed files with 13 additions and 2 deletions
  1. 1
    0
      src/libserver/worker_util.c
  2. 11
    2
      src/rspamd.c
  3. 1
    0
      src/rspamd.h

+ 1
- 0
src/libserver/worker_util.c View File

@@ -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:

+ 11
- 2
src/rspamd.c View File

@@ -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);
}
}

+ 1
- 0
src/rspamd.h View File

@@ -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 */

Loading…
Cancel
Save