]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Improve crash logging
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 16 Oct 2018 11:45:27 +0000 (12:45 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 16 Oct 2018 13:17:23 +0000 (14:17 +0100)
src/libserver/worker_util.c
src/rspamd.c
src/rspamd.h

index cdd98ded512761a2a3f8384bf18d718d37593c28..a0e51192962ae21fa837e965bed32ab97fe17861 100644 (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:
index fdc9b1b490a31a7bcac396aa98cb09d9502b8e56..4cf9ff28790c19d04d56ba5892ef23dafb9df420 100644 (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);
                                }
                        }
index 409c051b3df7845c6bd09323504dae31c18a163e..c6d4c209fbd14761ccd18e398fca36b173d0b14c 100644 (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                                                                       */