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

Commitbe4b0c0

Browse files
committed
Avoid lockup of a parallel worker when reporting a long error message.
Because sigsetjmp() will restore the initial state with signals blocked,the code path in bgworker.c for reporting an error and exiting wouldexecute that way. Usually this is fairly harmless; but if a parallelworker had an error message exceeding the shared-memory communicationbuffer size (16K) it would lock up, because it would wait for aresume-sending signal from its parallel leader which it would neverdetect.To fix, just unblock signals at the appropriate point.This can be shown to fail back to 9.6. The lack of parallel queryinfrastructure makes it difficult to provide a simple test case for9.5; but I'm pretty sure the issue exists in some form there as well,so apply the code change there too.Vignesh C, reviewed by Bharath Rupireddy, Robert Haas, and myselfDiscussion:https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com
1 parent8f8154a commitbe4b0c0

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

‎src/backend/postmaster/bgworker.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ StartBackgroundWorker(void)
743743
/*
744744
* If an exception is encountered, processing resumes here.
745745
*
746-
*See notes in postgres.c aboutthedesign of this coding.
746+
*We just need to clean up, reporttheerror, and go away.
747747
*/
748748
if (sigsetjmp(local_sigjmp_buf,1)!=0)
749749
{
@@ -753,7 +753,14 @@ StartBackgroundWorker(void)
753753
/* Prevent interrupts while cleaning up */
754754
HOLD_INTERRUPTS();
755755

756-
/* Report the error to the server log */
756+
/*
757+
* sigsetjmp will have blocked all signals, but we may need to accept
758+
* signals while communicating with our parallel leader. Once we've
759+
* done HOLD_INTERRUPTS() it should be safe to unblock signals.
760+
*/
761+
BackgroundWorkerUnblockSignals();
762+
763+
/* Report the error to the parallel leader and the server log */
757764
EmitErrorReport();
758765

759766
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp