File tree 1 file changed +11
-4
lines changed
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)
419
419
/*
420
420
* Reset background worker crash state.
421
421
*
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.
425
425
*/
426
426
void
427
427
ResetBackgroundWorkerCrashTimes (void )
@@ -433,7 +433,14 @@ ResetBackgroundWorkerCrashTimes(void)
433
433
RegisteredBgWorker * rw ;
434
434
435
435
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 ;
437
444
}
438
445
}
439
446
You can’t perform that action at this time.
0 commit comments