Skip to content

Commit

Permalink
Fix: sbd-inquisitor: use crashdump timeout
Browse files Browse the repository at this point in the history
Crashdump timeout was there in doc and cmdline implementation but
never used. Old default was 240s. Changed default to 0s (= don't
apply an extra crashdump timeout) as not to change the default
behavior.
  • Loading branch information
wenningerk committed Oct 28, 2019
1 parent b0d8bae commit 88a9981
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion man/sbd.8.pod
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ fencing agent's parameter -, SBD will adjust the watchdog timeout to this
setting before triggering the dump. Otherwise, the watchdog might trigger and
prevent a successful crashdump from ever being written.

Defaults to 240 seconds. Set to zero to disable.
Set to zero (= default) to disable.

=item B<-r> I<N>

Expand Down
18 changes: 13 additions & 5 deletions src/sbd-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int timeout_startup = 120;

int watchdog_use = 1;
int watchdog_set_timeout = 1;
unsigned long timeout_watchdog_crashdump = 240;
unsigned long timeout_watchdog_crashdump = 0;
int skip_rt = 0;
int debug = 0;
int debug_mode = 0;
Expand Down Expand Up @@ -89,7 +89,8 @@ usage(void)
"-4 <N> Set msgwait timeout to N seconds (optional, create only)\n"
"-5 <N> Warn if loop latency exceeds threshold (optional, watch only)\n"
" (default is 3, set to 0 to disable)\n"
"-C <N> Watchdog timeout to set before crashdumping (def: 240s, optional)\n"
"-C <N> Watchdog timeout to set before crashdumping\n"
" (def: 0s = disable gracefully, optional)\n"
"-I <N> Async IO read timeout (defaults to 3 * loop timeout, optional)\n"
"-s <N> Timeout to wait for devices to become available (def: 120s)\n"
"-t <N> Dampening delay before faulty servants are restarted (optional)\n"
Expand Down Expand Up @@ -930,10 +931,17 @@ do_exit(char kind, bool do_flush)
sync();
}

if(kind == 'c') {
watchdog_close(true);
if (kind == 'c') {
if (timeout_watchdog_crashdump) {
if (timeout_watchdog != timeout_watchdog_crashdump) {
timeout_watchdog = timeout_watchdog_crashdump;
watchdog_init_interval();
}
watchdog_close(false);
} else {
watchdog_close(true);
}
sysrq_trigger(kind);

} else {
watchdog_close(false);
sysrq_trigger(kind);
Expand Down

0 comments on commit 88a9981

Please sign in to comment.