From 9dc931524b7ece8c4661ab093e863c1b4a5f2d14 Mon Sep 17 00:00:00 2001 From: Sergio Gonzalez Monroy Date: Tue, 1 Oct 2019 15:23:23 +0200 Subject: [PATCH] comments r5 Fixes #3100 --- go/border/ifstate/ifstate.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/go/border/ifstate/ifstate.go b/go/border/ifstate/ifstate.go index 8c727bb1c0..140ed2f952 100644 --- a/go/border/ifstate/ifstate.go +++ b/go/border/ifstate/ifstate.go @@ -94,7 +94,7 @@ func NewInfo(ifID common.IFIDType, ia addr.IA, active bool, srev *path_mgmt.Sign // Process processes Interface State updates from the beacon service. func Process(ifStates *path_mgmt.IFStateInfos) { - cl := metrics.ControlLabels{} + cl := metrics.ControlLabels{Result: metrics.Success} ctx := rctx.Get() for _, info := range ifStates.Infos { var rawSRev common.RawBytes @@ -111,13 +111,9 @@ func Process(ifStates *path_mgmt.IFStateInfos) { } intf, ok := ctx.Conf.Topo.IFInfoMap[ifid] if !ok { - cl.Result = metrics.ErrProcess - metrics.Control.ReceivedIFStateInfo(cl).Inc() - log.Error("Interface ID does not exist", "ifid", ifid) + log.Warn("Interface ID does not exist", "ifid", ifid) continue } - cl.Result = metrics.Success - metrics.Control.ReceivedIFStateInfo(cl).Inc() stateInfo := NewInfo(ifid, intf.ISD_AS, info.Active, info.SRevInfo, rawSRev) s, ok := states.Load(ifid) if !ok { @@ -138,6 +134,7 @@ func Process(ifStates *path_mgmt.IFStateInfos) { } atomic.StorePointer(&s.info, unsafe.Pointer(stateInfo)) } + metrics.Control.ReceivedIFStateInfo(cl).Inc() } // LoadState returns the state info for a given interface ID or nil.