[MDEV-21343] Threadpool/Unix- wait_begin() function does not wake/create threads, when it should Created: 2019-12-17 Updated: 2020-08-25 Resolved: 2019-12-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 5.5.67, 10.1.44, 10.2.31, 10.3.22, 10.4.12, 10.5.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Vladislav Vaintroub | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
There is a bug in wait notification function that greately reduces its usefulness. Let's look at the condition under which threads are woken or created
thread_group->queue.is_empty() means empty request queue, or that there is no work to do. So wakeup/create thread is done if there is no work to do, but not if there is some work to do. It should actually be !thread_group->queue.is_empty() in that condition. Historical note : this condition was initially implemented correctly, until commit 18c9b345b43b62b7c4dbac8ce0289c1c8103c2d1 (Threadpool -address review comments) removed the negation. |