Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1f4ade

Browse files
committed
After a crash, don't restart workers with BGW_NEVER_RESTART.
Amit Khandekar
1 parent3ebe6d8 commita1f4ade

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎src/backend/postmaster/bgworker.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff 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 workersshould
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 workerswithout
424+
*the never-restart flag shouldbe restarted immediately, instead of waiting
425+
*for bgw_restart_time toelapse.
426426
*/
427427
void
428428
ResetBackgroundWorkerCrashTimes(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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp