Skip to content

Commit

Permalink
BUG/MEDIUM: queues: Adjust the proxy counters when appropriate
Browse files Browse the repository at this point in the history
In process_srv_queue(), if we manage to successfully run an extra task,
don't forget to adjust the proxy's totpend and served counters accordingly.
Having an inaccurate served could lead to various subtle bugs, as it is
used when making load balancing decisions.

This should not be backported, unless cda7275
is backported too.
  • Loading branch information
cognet committed Jan 9, 2025
1 parent 24042df commit 659d5f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,11 @@ int process_srv_queue(struct server *s)
* checked, but before we set ready_srv so it would not see it,
* just in case try to run one more stream.
*/
if (pendconn_process_next_strm(s, p, px_ok))
if (pendconn_process_next_strm(s, p, px_ok)) {
_HA_ATOMIC_SUB(&p->totpend, 1);
_HA_ATOMIC_ADD(&p->served, 1);
done++;
}
}
return done;
}
Expand Down

0 comments on commit 659d5f6

Please sign in to comment.