- Add new patches (see https://www.haproxy.org/bugs/bugs-1.8.13.html) - Raise PKG_RELEASE to 2 Signed-off-by: Christian Lachner <gladiac@gmail.com>
46 lines
1.9 KiB
Diff
46 lines
1.9 KiB
Diff
commit ef9b56022c656df34044103a317b7b890ced6628
|
|
Author: Willy Tarreau <w@1wt.eu>
|
|
Date: Tue Aug 7 10:14:53 2018 +0200
|
|
|
|
BUG/MEDIUM: servers: check the queues once enabling a server
|
|
|
|
Commit 64cc49c ("MAJOR: servers: propagate server status changes
|
|
asynchronously.") heavily changed the way the server states are
|
|
updated since they became asynchronous. During this change, some
|
|
code was lost, which is used to shut down some sessions from a
|
|
backup server and to pick pending connections from a proxy once
|
|
a server is turned back from maintenance to ready state. The
|
|
effect is that when temporarily disabling a server, connections
|
|
stay in the backend's queue, and when re-enabling it, they are
|
|
not picked and they expire in the backend's queue. Now they're
|
|
properly picked again.
|
|
|
|
This fix must be backported to 1.8.
|
|
|
|
(cherry picked from commit 6a78e61694d69beb49c0e8486be9550f5e8b7d08)
|
|
Signed-off-by: Willy Tarreau <w@1wt.eu>
|
|
|
|
diff --git a/src/server.c b/src/server.c
|
|
index 3d6a4093..fbed6cd4 100644
|
|
--- a/src/server.c
|
|
+++ b/src/server.c
|
|
@@ -4774,6 +4774,19 @@ void srv_update_status(struct server *s)
|
|
if (prev_srv_count && s->proxy->srv_bck == 0 && s->proxy->srv_act == 0)
|
|
set_backend_down(s->proxy);
|
|
|
|
+ /* If the server is set with "on-marked-up shutdown-backup-sessions",
|
|
+ * and it's not a backup server and its effective weight is > 0,
|
|
+ * then it can accept new connections, so we shut down all streams
|
|
+ * on all backup servers.
|
|
+ */
|
|
+ if ((s->onmarkedup & HANA_ONMARKEDUP_SHUTDOWNBACKUPSESSIONS) &&
|
|
+ !(s->flags & SRV_F_BACKUP) && s->next_eweight)
|
|
+ srv_shutdown_backup_streams(s->proxy, SF_ERR_UP);
|
|
+
|
|
+ /* check if we can handle some connections queued at the proxy. We
|
|
+ * will take as many as we can handle.
|
|
+ */
|
|
+ xferred = pendconn_grab_from_px(s);
|
|
}
|
|
else if (s->next_admin & SRV_ADMF_MAINT) {
|
|
/* remaining in maintenance mode, let's inform precisely about the
|