- Notifications
You must be signed in to change notification settings - Fork28
Commite0d97d7
committed
Fix deadlock with LWLockAcquireWithVar and LWLockWaitForVar.
LWLockRelease should release all backends waiting with LWLockWaitForVar,even when another backend has already been woken up to acquire the lock,i.e. when releaseOK is false. LWLockWaitForVar can return as soon as theprotected value changes, even if the other backend will acquire the lock.Fix that by resetting releaseOK to true in LWLockWaitForVar, wheneveradding itself to the wait queue.This should fix the bug reported by MauMau, where the system occasionallyhangs when there is a lot of concurrent WAL activity and a checkpoint.Backpatch to 9.4, where this code was added.1 parent0ff5047 commite0d97d7
1 file changed
+6
-0
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1005 | 1005 |
| |
1006 | 1006 |
| |
1007 | 1007 |
| |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1008 | 1014 |
| |
1009 | 1015 |
| |
1010 | 1016 |
| |
|
0 commit comments
Comments
(0)