]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: peers: Missing initializations after peer session shutdown.
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 27 Mar 2019 13:32:39 +0000 (14:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Mar 2019 14:16:25 +0000 (15:16 +0100)
This patch fixes a bug introduced by 045e0d4 commit where it was really a bad
idea to reset the peer applet context before shutting down the underlying
session. This had as side effect to cancel the re-initializations done by
peer_session_release(), especially prevented this function from re-initializing
the current table pointer which is there to force annoucement of stick-table
definitions on when reconnecting. Consequently the peers could send stick-table
update messages without a first stick-table definition message. As this is
forbidden, this leaded the remote peers to close the sessions.

src/peers.c

index 10045c62c8f8cba1cbd97624fc4872f3a306044f..a210de37f2dab34c8c8e6f501da52e58640cf71c 100644 (file)
@@ -2505,7 +2505,6 @@ static struct task *process_peer_sync(struct task * task, void *context, unsigne
                                                                else  {
                                                                        ps->reconnect = tick_add(now_ms, MS_TO_TICKS(50 + random() % 2000));
                                                                        peer_session_forceshutdown(ps->appctx);
-                                                                       ps->appctx = NULL;
                                                                }
                                                        }
                                                        else if (tick_is_expired(ps->heartbeat, now_ms)) {
@@ -2513,8 +2512,7 @@ static struct task *process_peer_sync(struct task * task, void *context, unsigne
                                                                ps->flags |= PEER_F_HEARTBEAT;
                                                                appctx_wakeup(ps->appctx);
                                                        }
-                                                       if (ps->appctx)
-                                                               task->expire = tick_first(ps->reconnect, ps->heartbeat);
+                                                       task->expire = tick_first(ps->reconnect, ps->heartbeat);
                                                }
                                        }
                                        /* else do nothing */