From 2c1a9dd82b82adb957fe65ffbc5ec21323421014 Mon Sep 17 00:00:00 2001 From: Andrew Martinez Date: Wed, 10 Feb 2021 10:58:50 -0500 Subject: [PATCH] ignores dupe router startup A second edge router starting up could offline the original according to the edge. This would cause issues w/ API Session and Session distribution. --- controller/env/broker.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controller/env/broker.go b/controller/env/broker.go index 9a33833c7..cae288431 100644 --- a/controller/env/broker.go +++ b/controller/env/broker.go @@ -794,7 +794,8 @@ func (b *Broker) ReceiveHello(r *network.Router, edgeRouter *model.EdgeRouter, r func (b *Broker) RouterDisconnected(r *network.Router) { go func() { - if r.Fingerprint != nil { + //ensure this wasn't the same router being started multiple times and the 2nd connection being refused w/ a close + if r.Fingerprint != nil && !b.ae.HostController.GetNetwork().ConnectedRouter(r.Id) { if edgeRouter, _ := b.ae.Handlers.EdgeRouter.ReadOneByFingerprint(*r.Fingerprint); edgeRouter != nil { b.edgeRouterMap.RemoveEntry(edgeRouter.Id) }