Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG/MEDIUM: quic_conn: let the scheduler kill the task when needed
The two timer handlers qc_process_timer() and qc_idle_timer_task() would inadvertently return NULL when they don't want to be requeued, instead of just returning the task itself. The effect of returning NULL for the scheduler is that it considers the task as freed, so it must not touch it anymore. As such, the TASK_F_RUNNING flag is never removed from these tasks, and when quic_conn_release() later tries to release these tasks using task_destroy(), the latter sees the RUNNING flag and just sets ->process to NULL, hoping that the scheduler will kill them on return, but there's no longer being executed so this never happens and they are leaked. Interestingly, this doesn't seem to happen as much when multi-queue is set to off, but it's likely because the tasks are being replaced and the first ones have already been woken up and leaked, while the latter might only trigger on a timeout or timer renewal. This should address github issue haproxy#2310. Thanks to @hpn0t0ad for the numerous traces that helped understand this sequence. This must be backported to 2.7 at least, and adapted for 2.6 (qc_idle_timer_task must return t there). (cherry picked from commit 4070e40) Signed-off-by: Willy Tarreau <[email protected]>
- Loading branch information