Since the following patch, proxy internal management task is only
created for frontends or if a stick-table is present. This notably
serves to purge expired entries from tables on soft-stop.
a4a17eb36698c927de1c3171236fcc5a6997721a
OPTIM/MINOR: proxy: do not init proxy management task if unused
However, the condition was incorrectly written, as it is never true for
the stick-table case. This is because table's <current> member is always
zero at parse time as the stick-table is still empty. Thus, the task is
not allocated for backends even if stick-table is declared. This results
in worker processes potentially leaving expired entries in stick-tables.
The error originates from reusing the condition from manage_proxy(),
which performs the stick-table cleanup. In this context it makes sense
to check <current> value.
Fix the condition to ensure the task is allocated when a stick-table is
declared. Checking the proxy's <table> member is sufficient for that.
This fixes github issue #3554.
This must be backported up to 3.4.
/* Create the task associated with the proxy. Only necessary
* for frontend or if a stick-table is defined.
*/
- if ((curproxy->cap & PR_CAP_FE) || (curproxy->table && curproxy->table->current)) {
+ if ((curproxy->cap & PR_CAP_FE) || curproxy->table) {
curproxy->task = task_new_anywhere();
if (curproxy->task) {
curproxy->task->context = curproxy;