]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: task: Don't defer tasks release when HAProxy is stopping
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 25 May 2022 07:31:20 +0000 (09:31 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 25 May 2022 13:31:21 +0000 (15:31 +0200)
commitd9404b464faae3340ac1745b594929e4b7edd650
treee2d4c231eb20c30a174a5e4a603666f0725eff00
parentca82578fe82bc8fadec675efc60b56e2cea4feaf
BUG/MINOR: task: Don't defer tasks release when HAProxy is stopping

A running or queued task is not released when task_destroy() is called,
except if it is the current task. Its process function is set to NULL and we
let the scheduler to release the task. However, when HAProxy is stopping, it
never happens and some tasks may leak. To fix the issue, we now also rely on
the global MODE_STOPPING flag. When this flag is set, the task is always
immediately released.

This patch should fix the issue #1714. It could be backported as far as 2.4
but it's not a real problem in practice because it only happens on
deinit. The leak exists on previous versions but not MODE_STOPPING flag.
include/haproxy/task.h