Commit b3a5e76e authored by Robert Haas's avatar Robert Haas

After a crash, don't restart workers with BGW_NEVER_RESTART.

Amit Khandekar
parent abd94bca
......@@ -419,9 +419,9 @@ BackgroundWorkerStopNotifications(pid_t pid)
/*
* Reset background worker crash state.
*
* We assume that, after a crash-and-restart cycle, background workers should
* be restarted immediately, instead of waiting for bgw_restart_time to
* elapse.
* We assume that, after a crash-and-restart cycle, background workers without
* the never-restart flag should be restarted immediately, instead of waiting
* for bgw_restart_time to elapse.
*/
void
ResetBackgroundWorkerCrashTimes(void)
......@@ -433,7 +433,14 @@ ResetBackgroundWorkerCrashTimes(void)
RegisteredBgWorker *rw;
rw = slist_container(RegisteredBgWorker, rw_lnode, iter.cur);
rw->rw_crashed_at = 0;
/*
* For workers that should not be restarted, we don't want to lose
* the information that they have crashed; otherwise, they would be
* restarted, which is wrong.
*/
if (rw->rw_worker.bgw_restart_time != BGW_NEVER_RESTART)
rw->rw_crashed_at = 0;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment