Skip to content

Commit

Permalink
Only delay the restart of fdbserver if the process exited with an exi…
Browse files Browse the repository at this point in the history
…t code other than 0
  • Loading branch information
johscheuer committed Nov 21, 2024
1 parent 6e5fc2a commit ea6991d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fdbmonitor/fdbmonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,16 @@ int main(int argc, char** argv) {
int delay = cmd->get_and_update_current_restart_delay();
if (!cmd->quiet) {
if (WIFEXITED(child_status)) {
Severity priority = (WEXITSTATUS(child_status) == 0) ? SevWarn : SevError;
Severity priority;
// If the process exited successfully, e.g. because someone restarted the process
// with fdbcli kill we don't want to delay the restart. We only want to delay
// the restart if the process was exited unsuccessfully (exit code different from 0).
if (WEXITSTATUS(child_status) == 0) {
priority = SevWarn;
delay = 0;
} else {
priority = SevError;
}
log_process_msg(priority,
cmd->ssection.c_str(),
"Process %d exited %d, restarting in %d seconds\n",
Expand Down

0 comments on commit ea6991d

Please sign in to comment.