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 (apple#11802)
  • Loading branch information
johscheuer authored Dec 2, 2024
1 parent cf0a2a8 commit 5f6509f
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 5f6509f

Please sign in to comment.