Commit babf185
committed
Fix busy-wait in pgbench, with --rate.
If --rate was used to throttle pgbench, it failed to sleep when it had
nothing to do, leading to a busy-wait with 100% CPU usage. This bug was
introduced in the refactoring in v10. Before that, sleep() was called with
a timeout, even when there were no file descriptors to wait for.
Reported by Jeff Janes, patch by Fabien COELHO. Backpatch to v10.
Discussion: https://www.postgresql.org/message-id/CAMkU%3D1x5hoX0pLLKPRnXCy0T8uHoDvXdq%2B7kAM9eoC9_z72ucw%40mail.gmail.com1 parent 2aab702 commit babf185
1 file changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4539 | 4539 | | |
4540 | 4540 | | |
4541 | 4541 | | |
4542 | | - | |
| 4542 | + | |
4543 | 4543 | | |
4544 | | - | |
| 4544 | + | |
4545 | 4545 | | |
4546 | 4546 | | |
4547 | 4547 | | |
4548 | | - | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
4549 | 4551 | | |
4550 | | - | |
4551 | | - | |
4552 | | - | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
4553 | 4560 | | |
4554 | | - | |
| 4561 | + | |
| 4562 | + | |
4555 | 4563 | | |
| 4564 | + | |
| 4565 | + | |
4556 | 4566 | | |
4557 | 4567 | | |
4558 | 4568 | | |
| |||
4565 | 4575 | | |
4566 | 4576 | | |
4567 | 4577 | | |
4568 | | - | |
| 4578 | + | |
4569 | 4579 | | |
4570 | 4580 | | |
4571 | 4581 | | |
| |||
0 commit comments