]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3189 ok, patch added, but have you discovered why you trigger this because its...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 30 Mar 2011 02:05:04 +0000 (21:05 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 30 Mar 2011 02:05:04 +0000 (21:05 -0500)
conf/sip_profiles/internal.xml
src/mod/endpoints/mod_sofia/sofia.c

index b78ea20070341904a506efbbb50fd1d83ccff612..b803bcea6d0467542676b304d290ee6fad539a36 100644 (file)
@@ -47,8 +47,8 @@
         Sometimes, in extremely rare edge cases, the Sofia SIP stack may stop
         responding. These options allow you to enable and control a watchdog
         on the Sofia SIP stack so that if it stops responding for the
-        specified number of milliseconds, it will cause FreeSWITCH to shut
-        down immediately. This is useful if you run in an HA environment and
+        specified number of milliseconds, it will cause FreeSWITCH to crash
+        immediately. This is useful if you run in an HA environment and
         need to ensure automated recovery from such a condition. Note that if
         your server is idle a lot, the watchdog may fire due to not receiving
         any SIP messages. Thus, if you expect your system to be idle, you
@@ -57,6 +57,8 @@
         globally for all profiles. So, if you run in an HA environment with a
         master and slave, you should use the CLI to make sure the watchdog is
         only enabled on the master. 
+        If such crash occurs, FreeSWITCH will dump core if allowed. The
+        stacktrace will include function watchdog_triggered_abort().
     -->
     <param name="watchdog-enabled" value="no"/>
     <param name="watchdog-step-timeout" value="30000"/>
index ca9b0cd9746e01e6b0f2f5035defe0aba7c7f47b..5a3ad76680f67fba0b374bae351fce24df99a964 100644 (file)
@@ -1275,6 +1275,11 @@ static void sofia_perform_profile_start_failure(sofia_profile_t *profile, char *
        }
 }
 
+/* not a static function so that it's still visible on stacktraces */
+void watchdog_triggered_abort(void) {
+       abort();
+}
+
 #define sofia_profile_start_failure(p, xp) sofia_perform_profile_start_failure(p, xp, __FILE__, __LINE__)
 
 
@@ -1390,10 +1395,10 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
                                }
 
                                if (event_fail || step_fail) {
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile %s: SIP STACK FAILURE DETECTED!\n"
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile %s: SIP STACK FAILURE DETECTED BY WATCHDOG!\n"
                                                                          "GOODBYE CRUEL WORLD, I'M LEAVING YOU TODAY....GOODBYE, GOODBYE, GOOD BYE\n", profile->name);
                                        switch_yield(2000000);
-                                       abort();
+                                       watchdog_triggered_abort();
                                }
                        }