Skip to content

Commit

Permalink
BUG/MEDIUM: listener/proxy: fix listeners notify for proxy resume (2n…
Browse files Browse the repository at this point in the history
…d try)

In 7741928 ("BUG/MEDIUM: listener/proxy: fix listeners notify for proxy
resume"), we changed the way we detect that the proxy is resumed by
checking the suspend counter instead of the paused counter to take into
account listeners that don't support being paused such as abns socket.

However, the backport note for the 2.4 version was wrong. Since we don't
have the PR_FL_PAUSED flag, we must still ensure that we report the
change only if the proxy was previously suspended. It can be done by
comparing the new state with the previous state like it was done prior to
7741928.

This bug was raised by Sebastien: it can be easily reproduced when proxy
rate-limiting directives such as 'maxconnrate' are used and the proxy
becomes limited and is then relaxed when the rate becomes acceptable
again. Due to this, a lot of polluting logs could be generated:

   [WARNING] (2661577) : Resumed frontend GLOBAL.
   [WARNING] (2661577) : Resumed frontend GLOBAL.
   [WARNING] (2661577) : Resumed frontend GLOBAL.

This is a 2.4 only fix, no backport needed.
  • Loading branch information
Darlelet authored and capflam committed Nov 24, 2023
1 parent 99d2241 commit 659a23b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ int suspend_listener(struct listener *l, int lpx, int lli)
int resume_listener(struct listener *l, int lpx, int lli)
{
struct proxy *px = l->bind_conf->frontend;
int was_suspended = px && px->li_suspended;
int ret = 1;

if (!lpx && px)
Expand Down Expand Up @@ -567,7 +568,7 @@ int resume_listener(struct listener *l, int lpx, int lli)
px->li_suspended--;
l->flags &= ~LI_F_SUSPENDED;

if (px && !px->li_suspended) {
if (was_suspended && !px->li_suspended) {
ha_warning("Resumed %s %s.\n", proxy_cap_str(px->cap), px->id);
send_log(px, LOG_WARNING, "Resumed %s %s.\n", proxy_cap_str(px->cap), px->id);
}
Expand Down

0 comments on commit 659a23b

Please sign in to comment.