File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -419,9 +419,9 @@ BackgroundWorkerStopNotifications(pid_t pid)
419419/*
420420 * Reset background worker crash state.
421421 *
422- * We assume that, after a crash-and-restart cycle, background workers should
423- * be restarted immediately, instead of waiting for bgw_restart_time to
424- * elapse.
422+ * We assume that, after a crash-and-restart cycle, background workers without
423+ * the never-restart flag should be restarted immediately, instead of waiting
424+ * for bgw_restart_time to elapse.
425425 */
426426void
427427ResetBackgroundWorkerCrashTimes (void )
@@ -433,7 +433,14 @@ ResetBackgroundWorkerCrashTimes(void)
433433 RegisteredBgWorker * rw ;
434434
435435 rw = slist_container (RegisteredBgWorker , rw_lnode , iter .cur );
436- rw -> rw_crashed_at = 0 ;
436+
437+ /*
438+ * For workers that should not be restarted, we don't want to lose
439+ * the information that they have crashed; otherwise, they would be
440+ * restarted, which is wrong.
441+ */
442+ if (rw -> rw_worker .bgw_restart_time != BGW_NEVER_RESTART )
443+ rw -> rw_crashed_at = 0 ;
437444 }
438445}
439446
You can’t perform that action at this time.
0 commit comments