mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02: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: {
|
case STD_T_FRQP: {
|
||||||
struct freq_ctr_period data;
|
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) {
|
if (!msg_cur) {
|
||||||
/* malformed message */
|
/* malformed message */
|
||||||
RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
|
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.
|
* push measures without having to update them too often.
|
||||||
*/
|
*/
|
||||||
frqp = &stktable_data_cast(ptr, std_t_frqp);
|
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->prev_ctr = 0;
|
||||||
frqp->curr_ctr = value;
|
frqp->curr_ctr = value;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user