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)
420
420
/*
421
421
* Reset background worker crash state.
422
422
*
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.
426
426
*/
427
427
void
428
428
ResetBackgroundWorkerCrashTimes (void )
@@ -434,7 +434,14 @@ ResetBackgroundWorkerCrashTimes(void)
434
434
RegisteredBgWorker * rw ;
435
435
436
436
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 ;
438
445
}
439
446
}
440
447
You can’t perform that action at this time.
0 commit comments