Commit 396ef15
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 2632bcc commit 396ef15
1 file changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4578 | 4578 | | |
4579 | 4579 | | |
4580 | 4580 | | |
4581 | | - | |
| 4581 | + | |
4582 | 4582 | | |
4583 | | - | |
| 4583 | + | |
4584 | 4584 | | |
4585 | 4585 | | |
4586 | 4586 | | |
4587 | | - | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
4588 | 4590 | | |
4589 | | - | |
4590 | | - | |
4591 | | - | |
| 4591 | + | |
| 4592 | + | |
| 4593 | + | |
| 4594 | + | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
4592 | 4599 | | |
4593 | | - | |
| 4600 | + | |
| 4601 | + | |
4594 | 4602 | | |
| 4603 | + | |
| 4604 | + | |
4595 | 4605 | | |
4596 | 4606 | | |
4597 | 4607 | | |
| |||
4604 | 4614 | | |
4605 | 4615 | | |
4606 | 4616 | | |
4607 | | - | |
| 4617 | + | |
4608 | 4618 | | |
4609 | 4619 | | |
4610 | 4620 | | |
| |||
0 commit comments