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

Commit78aaa0e

Browse files
committed
Don't reset latch in ConditionVariablePrepareToSleep().
It's not OK to do that without calling CHECK_FOR_INTERRUPTS().Let the next wait loop deal with it, following the usual pattern.One consequence of this bug was that a SIGTERM delivered in a verynarrow timing window could leave a parallel worker process waitingforever for a condition variable that will never be signaled, afteran error was raised in other process.The code is a bit different in the stable branches due to commit1321509, making problems less likely there. No back-patch for now,but we may finish up deciding to make a similar change after morediscussion.Author: Thomas MunroReviewed-by: Shawn DebnathReported-by: Tomas VondraDiscussion:https://postgr.es/m/CA%2BhUKGJOm8zZHjVA8svoNT3tHY0XdqmaC_kHitmgXDQM49m1dA%40mail.gmail.com
1 parent05f18c6 commit78aaa0e

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

‎src/backend/storage/lmgr/condition_variable.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ ConditionVariablePrepareToSleep(ConditionVariable *cv)
9393
/* Record the condition variable on which we will sleep. */
9494
cv_sleep_target=cv;
9595

96-
/*
97-
* Reset my latch before adding myself to the queue, to ensure that we
98-
* don't miss a wakeup that occurs immediately.
99-
*/
100-
ResetLatch(MyLatch);
101-
10296
/* Add myself to the wait queue. */
10397
SpinLockAcquire(&cv->mutex);
10498
proclist_push_tail(&cv->wakeup,pgprocno,cvWaitLink);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp