forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita39e78b
committed
Block signals while computing the sleep time in postmaster's main loop.
DetermineSleepTime() was previously called without blockedsignals. That's not good, because it allows signal handlers tointerrupt its workings.DetermineSleepTime() was added in 9.3 with the addition of backgroundworkers (da07a1e), where it only read fromBackgroundWorkerList.Since 9.4, where dynamic background workers were added (7f7485a),the list is also manipulated in DetermineSleepTime(). That's badbecause the list now can be persistently corrupted if modified by botha signal handler and DetermineSleepTime().This was discovered during the investigation of hangs on buildfarmmember anole. It's unclear whether this bug is the source of thesehangs or not, but it's worth fixing either way. I have confirmed thatit can cause crashes.It luckily looks like this only can cause problems when bgworkers areactively used.Discussion: 20140929193733.GB14400@awork2.anarazel.deBackpatch to 9.3 where background workers were introduced.1 parent32984d8 commita39e78b
1 file changed
+16
-10
lines changedLines changed: 16 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1482 | 1482 |
| |
1483 | 1483 |
| |
1484 | 1484 |
| |
| 1485 | + | |
| 1486 | + | |
1485 | 1487 |
| |
1486 | 1488 |
| |
1487 | 1489 |
| |
| |||
1503 | 1505 |
| |
1504 | 1506 |
| |
1505 | 1507 |
| |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
1506 | 1512 |
| |
1507 |
| - | |
1508 |
| - | |
| 1513 | + | |
1509 | 1514 |
| |
1510 | 1515 |
| |
1511 | 1516 |
| |
1512 |
| - | |
1513 |
| - | |
1514 | 1517 |
| |
1515 | 1518 |
| |
| 1519 | + | |
| 1520 | + | |
1516 | 1521 |
| |
1517 | 1522 |
| |
| 1523 | + | |
| 1524 | + | |
1518 | 1525 |
| |
1519 | 1526 |
| |
1520 | 1527 |
| |
1521 | 1528 |
| |
1522 | 1529 |
| |
1523 | 1530 |
| |
| 1531 | + | |
1524 | 1532 |
| |
1525 | 1533 |
| |
| 1534 | + | |
| 1535 | + | |
1526 | 1536 |
| |
1527 |
| - | |
1528 | 1537 |
| |
1529 |
| - | |
1530 |
| - | |
1531 |
| - | |
1532 |
| - | |
1533 |
| - | |
| 1538 | + | |
| 1539 | + | |
1534 | 1540 |
| |
1535 | 1541 |
| |
1536 | 1542 |
| |
|
0 commit comments
Comments
(0)