From: Willy Tarreau Date: Fri, 12 Apr 2024 07:57:32 +0000 (+0200) Subject: BUG/MEDIUM: stick-tables: fix the task's next expiration date X-Git-Tag: v3.0-dev8~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44a8f9e7fc4abcadbb72b1ac2cb41f7c788dae55;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stick-tables: fix the task's next expiration date While changing the stick-table indexing that led to commit 1a088da7c ("MAJOR: stktable: split the keys across multiple shards to reduce contention"), I met a problem with the task's expiration date being incorrectly updated, I fixed it and apparently I committed the wrong version :-/ The effect is that the task's date is only correctly reset if the table is empty, otherwise the task wakes up again and is queued at the previous date, eating 100% CPU. The tick_isfirst() must not be used when storing the last result. No backport is needed as this was only merged in 3.0-dev7. --- diff --git a/src/stick_table.c b/src/stick_table.c index debec567cf..0a00129781 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -903,7 +903,7 @@ struct task *process_table_expire(struct task *task, void *context, unsigned int * were to update with TICK_ETERNITY. */ HA_RWLOCK_WRLOCK(STK_TABLE_LOCK, &t->lock); - task->expire = tick_first(task->expire, task_exp); + task->expire = task_exp; HA_RWLOCK_WRUNLOCK(STK_TABLE_LOCK, &t->lock); return task;