MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / watchdogSignalHandler

Function watchdogSignalHandler

src/debug.cpp:2138–2156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2136#include <sys/time.h>
2137
2138void watchdogSignalHandler(int sig, siginfo_t *info, void *secret) {
2139#ifdef HAVE_BACKTRACE
2140 ucontext_t *uc = (ucontext_t*) secret;
2141#else
2142 (void)secret;
2143#endif
2144 UNUSED(info);
2145 UNUSED(sig);
2146
2147 serverLogFromHandler(LL_WARNING,"\n--- WATCHDOG TIMER EXPIRED ---");
2148#ifdef HAVE_BACKTRACE
2149 logStackTrace(getMcontextEip(uc), 1);
2150#elif defined UNW_LOCAL_ONLY
2151 logStackTrace(NULL, 1);
2152#else
2153 serverLogFromHandler(LL_WARNING,"Sorry: no support for backtrace().");
2154#endif
2155 serverLogFromHandler(LL_WARNING,"--------\n");
2156}
2157
2158/* Schedule a SIGALRM delivery after the specified period in milliseconds.
2159 * If a timer is already scheduled, this function will re-schedule it to the

Callers

nothing calls this directly

Calls 3

serverLogFromHandlerFunction · 0.85
getMcontextEipFunction · 0.85
logStackTraceFunction · 0.70

Tested by

no test coverage detected