From 9ab5c64868701b145b6f3bbb4080e79e582c2a14 Mon Sep 17 00:00:00 2001 From: rewenset Date: Fri, 12 Mar 2021 18:06:21 +0200 Subject: [PATCH 1/2] fix: Do not release mutex for printing log message --- plugins/vpp/ifplugin/interface_state.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/vpp/ifplugin/interface_state.go b/plugins/vpp/ifplugin/interface_state.go index 666bf6eaa7..e0a164d60d 100644 --- a/plugins/vpp/ifplugin/interface_state.go +++ b/plugins/vpp/ifplugin/interface_state.go @@ -248,13 +248,9 @@ func (c *InterfaceStateUpdater) doUpdatesIfStateDetails() { return } - // we dont want to lock during potentionally long dump call - c.access.Unlock() - c.log.Debugf("updating interface states for %d interfaces", len(c.ifsForUpdate)) var ifIdxs []uint32 - c.access.Lock() if len(c.ifsForUpdate) < 1000 { for ifIdx := range c.ifsForUpdate { ifIdxs = append(ifIdxs, ifIdx) @@ -262,6 +258,8 @@ func (c *InterfaceStateUpdater) doUpdatesIfStateDetails() { } // clear interfaces for update c.ifsForUpdate = make(map[uint32]struct{}) + + // we dont want to lock during potentionally long dump call c.access.Unlock() ifaces, err := c.ifHandler.DumpInterfaceStates(ifIdxs...) From 27995879e376cb14d8f23b88edab702c42aa3a16 Mon Sep 17 00:00:00 2001 From: rewenset Date: Fri, 12 Mar 2021 18:27:29 +0200 Subject: [PATCH 2/2] fix: typo --- plugins/vpp/ifplugin/interface_state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/vpp/ifplugin/interface_state.go b/plugins/vpp/ifplugin/interface_state.go index e0a164d60d..35b9fd472a 100644 --- a/plugins/vpp/ifplugin/interface_state.go +++ b/plugins/vpp/ifplugin/interface_state.go @@ -259,7 +259,7 @@ func (c *InterfaceStateUpdater) doUpdatesIfStateDetails() { // clear interfaces for update c.ifsForUpdate = make(map[uint32]struct{}) - // we dont want to lock during potentionally long dump call + // we dont want to lock during potentially long dump call c.access.Unlock() ifaces, err := c.ifHandler.DumpInterfaceStates(ifIdxs...)