diff --git a/pkg/router/route_group.go b/pkg/router/route_group.go index 02be1b1527..31240c0a7b 100644 --- a/pkg/router/route_group.go +++ b/pkg/router/route_group.go @@ -354,6 +354,7 @@ func (rg *RouteGroup) sendKeepAlive() error { packet := routing.MakeKeepAlivePacket(rule.KeyRouteID()) if err := tp.WritePacket(context.Background(), packet); err != nil { + rg.logger.WithError(err).Error("Failed to send keep-alive packet") return err } @@ -380,10 +381,7 @@ func (rg *RouteGroup) close(code routing.CloseCode) error { rg.closeDone.Add(len(rg.tps)) } - if err := rg.broadcastClosePackets(code); err != nil { - // TODO: decide if we should return this error, or close route group anyway - return err - } + rg.broadcastClosePackets(code) if closeInitiator { // if this node initiated closing, we need to wait for close packets @@ -430,16 +428,13 @@ func (rg *RouteGroup) handleClosePacket(code routing.CloseCode) error { return rg.close(code) } -func (rg *RouteGroup) broadcastClosePackets(code routing.CloseCode) error { +func (rg *RouteGroup) broadcastClosePackets(code routing.CloseCode) { for i := 0; i < len(rg.tps); i++ { packet := routing.MakeClosePacket(rg.fwd[i].KeyRouteID(), code) if err := rg.tps[i].WritePacket(context.Background(), packet); err != nil { - // TODO: decide if we should return this error, or close route group anyway - return err + rg.logger.WithError(err).Error("Failed to send close packet") } } - - return nil } func (rg *RouteGroup) waitForCloseLoop(waitTimeout time.Duration) error { diff --git a/pkg/transport/managed_transport.go b/pkg/transport/managed_transport.go index 062b677b9b..c4f19e0ac3 100644 --- a/pkg/transport/managed_transport.go +++ b/pkg/transport/managed_transport.go @@ -151,7 +151,7 @@ func (mt *ManagedTransport) Serve(readCh chan<- routing.Packet, done <-chan stru mt.connMx.Lock() if mt.conn == nil { if err := mt.dial(ctx); err != nil { - mt.log.Warnf("failed to redial underlying connection: %v", err) + mt.log.Warnf("failed to redial underlying connection (redial loop): %v", err) } } mt.connMx.Unlock()