mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-15 16:04:37 +00:00
BUG/MINOR: freq: fix infinite loop on freq_ctr_period.
Using peers or stick table we could update an freq_ctr using a tick value with the first bit set but this bit is reserved for lock since multithreading support.
This commit is contained in:
parent
4b75fffa2b
commit
f2fc1fda80
@ -1312,7 +1312,12 @@ switchstate:
|
||||
case STD_T_FRQP: {
|
||||
struct freq_ctr_period data;
|
||||
|
||||
data.curr_tick = tick_add(now_ms, -intdecode(&msg_cur, msg_end));
|
||||
/* First bit is reserved for the freq_ctr_period lock
|
||||
Note: here we're still protected by the stksess lock
|
||||
so we don't need to update the update the freq_ctr_period
|
||||
using its internal lock */
|
||||
|
||||
data.curr_tick = tick_add(now_ms, -intdecode(&msg_cur, msg_end)) & ~0x1;
|
||||
if (!msg_cur) {
|
||||
/* malformed message */
|
||||
RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
|
||||
|
@ -2968,7 +2968,11 @@ static int table_process_entry_per_key(struct appctx *appctx, char **args)
|
||||
* push measures without having to update them too often.
|
||||
*/
|
||||
frqp = &stktable_data_cast(ptr, std_t_frqp);
|
||||
frqp->curr_tick = now_ms;
|
||||
/* First bit is reserved for the freq_ctr_period lock
|
||||
Note: here we're still protected by the stksess lock
|
||||
so we don't need to update the update the freq_ctr_period
|
||||
using its internal lock */
|
||||
frqp->curr_tick = now_ms & ~0x1;
|
||||
frqp->prev_ctr = 0;
|
||||
frqp->curr_ctr = value;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user