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

Commitb3a5e76

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

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
@@ -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 workersshould
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 workerswithout
423+
*the never-restart flag shouldbe restarted immediately, instead of waiting
424+
*for bgw_restart_time toelapse.
425425
*/
426426
void
427427
ResetBackgroundWorkerCrashTimes(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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp