From 052e6cd07a84fc01401e8125a128376cb22d1b0a Mon Sep 17 00:00:00 2001 From: Christoph Petrausch <christoph.petrausch@inovex.de> Date: Tue, 29 May 2018 13:46:53 +0200 Subject: [PATCH] Added logging for failing AddPath --- routingtable/adjRIBIn/adj_rib_in.go | 7 ++++++- routingtable/adjRIBOut/adj_rib_out.go | 6 +++++- routingtable/adjRIBOutAddPath/adj_rib_out_add_path.go | 6 +++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/routingtable/adjRIBIn/adj_rib_in.go b/routingtable/adjRIBIn/adj_rib_in.go index 1427278b..cd4dde58 100644 --- a/routingtable/adjRIBIn/adj_rib_in.go +++ b/routingtable/adjRIBIn/adj_rib_in.go @@ -6,6 +6,7 @@ import ( "github.com/bio-routing/bio-rd/net" "github.com/bio-routing/bio-rd/route" "github.com/bio-routing/bio-rd/routingtable" + log "github.com/sirupsen/logrus" ) // AdjRIBIn represents an Adjacency RIB In as described in RFC4271 @@ -33,7 +34,11 @@ func (a *AdjRIBIn) UpdateNewClient(client routingtable.RouteTableClient) error { for _, route := range routes { paths := route.Paths() for _, path := range paths { - client.AddPath(route.Prefix(), path) + + err := client.AddPath(route.Prefix(), path) + if err != nil { + log.WithField("Sender", "AdjRIBOutAddPath").WithError(err).Error("Could not send update to client") + } } } return nil diff --git a/routingtable/adjRIBOut/adj_rib_out.go b/routingtable/adjRIBOut/adj_rib_out.go index 1ddd93c6..51347119 100644 --- a/routingtable/adjRIBOut/adj_rib_out.go +++ b/routingtable/adjRIBOut/adj_rib_out.go @@ -7,6 +7,7 @@ import ( "github.com/bio-routing/bio-rd/net" "github.com/bio-routing/bio-rd/route" "github.com/bio-routing/bio-rd/routingtable" + log "github.com/sirupsen/logrus" ) // AdjRIBOut represents an Adjacency RIB In as described in RFC4271 @@ -45,7 +46,10 @@ func (a *AdjRIBOut) AddPath(pfx net.Prefix, p *route.Path) error { a.removePathsFromClients(pfx, oldPaths) for _, client := range a.ClientManager.Clients() { - client.AddPath(pfx, p) + err := client.AddPath(pfx, p) + if err != nil { + log.WithField("Sender", "AdjRIBOut").WithError(err).Error("Could not send update to client") + } } return nil } diff --git a/routingtable/adjRIBOutAddPath/adj_rib_out_add_path.go b/routingtable/adjRIBOutAddPath/adj_rib_out_add_path.go index 2b4dff95..90f76fcc 100644 --- a/routingtable/adjRIBOutAddPath/adj_rib_out_add_path.go +++ b/routingtable/adjRIBOutAddPath/adj_rib_out_add_path.go @@ -7,6 +7,7 @@ import ( "github.com/bio-routing/bio-rd/net" "github.com/bio-routing/bio-rd/route" "github.com/bio-routing/bio-rd/routingtable" + log "github.com/sirupsen/logrus" ) // AdjRIBOutAddPath represents an Adjacency RIB Out with BGP add path @@ -52,7 +53,10 @@ func (a *AdjRIBOutAddPath) AddPath(pfx net.Prefix, p *route.Path) error { a.rt.AddPath(pfx, p) for _, client := range a.ClientManager.Clients() { - client.AddPath(pfx, p) + err := client.AddPath(pfx, p) + if err != nil { + log.WithField("Sender", "AdjRIBOutAddPath").WithError(err).Error("Could not send update to client") + } } return nil } -- GitLab