The commit
9938fb9c7 ("BUG/MEDIUM: stick-tables: Fix race with peers when
killing a sticky session") introduced a regression.
__stksess_kill() must always return 0 if the session cannot be released. But
when the ref_cnt is tested under the update lock, a success is reported if
the session is still in-used. 0 must be returned in that case.
This bug is harmless because callers never use the return value of
__stksess_kill() or stksess_kill().
This bug must be backported as far as 3.0.
int __stksess_kill(struct stktable *t, struct stksess *ts)
{
int updt_locked = 0;
+ int removed = 0;
if (HA_ATOMIC_LOAD(&ts->ref_cnt))
return 0;
eb32_delete(&ts->upd);
ebmb_delete(&ts->key);
__stksess_free(t, ts);
+ removed = 1;
out_unlock:
if (updt_locked)
HA_RWLOCK_WRUNLOCK(STK_TABLE_UPDT_LOCK, &t->updt_lock);
- return 1;
+ return removed;
}
/*