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 @@ -420,9 +420,9 @@ BackgroundWorkerStopNotifications(pid_t pid)
420420/*
421421 * Reset background worker crash state.
422422 *
423- * We assume that, after a crash-and-restart cycle, background workers should
424- * be restarted immediately, instead of waiting for bgw_restart_time to
425- * elapse.
423+ * We assume that, after a crash-and-restart cycle, background workers without
424+ * the never-restart flag should be restarted immediately, instead of waiting
425+ * for bgw_restart_time to elapse.
426426 */
427427void
428428ResetBackgroundWorkerCrashTimes (void )
@@ -434,7 +434,14 @@ ResetBackgroundWorkerCrashTimes(void)
434434 RegisteredBgWorker * rw ;
435435
436436 rw = slist_container (RegisteredBgWorker , rw_lnode , iter .cur );
437- rw -> rw_crashed_at = 0 ;
437+
438+ /*
439+ * For workers that should not be restarted, we don't want to lose
440+ * the information that they have crashed; otherwise, they would be
441+ * restarted, which is wrong.
442+ */
443+ if (rw -> rw_worker .bgw_restart_time != BGW_NEVER_RESTART )
444+ rw -> rw_crashed_at = 0 ;
438445 }
439446}
440447
You can’t perform that action at this time.
0 commit comments