diff options
author | wanghonghao <wanghonghao@bytedance.com> | 2018-09-18 20:55:39 +0800 |
---|---|---|
committer | wanghonghao <wanghonghao@bytedance.com> | 2018-09-18 20:55:39 +0800 |
commit | 98d4679e316431fae6ba429e21278049a65f969a (patch) | |
tree | 3667b7251e6864b14b6402243c4aff8ef9d5f8d4 /pkg/server/server.go | |
parent | 70d3ddfd662d9c100b37b9875de1c0c256699931 (diff) |
fsm: get rid of dead lock
Diffstat (limited to 'pkg/server/server.go')
-rw-r--r-- | pkg/server/server.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go index 20f5d609..0e96c73c 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -1664,6 +1664,7 @@ func (s *BgpServer) SetPolicies(ctx context.Context, r *api.SetPoliciesRequest) }).Info("call set policy") a, err := getConfig(peer.ID()) if err != nil { + peer.fsm.lock.RUnlock() return err } ap[peer.ID()] = *a @@ -2126,12 +2127,12 @@ func (s *BgpServer) softResetOut(addr string, family bgp.RouteFamily, deferral b if restarting { peer.fsm.lock.Lock() peer.fsm.pConf.GracefulRestart.State.LocalRestarting = false + peer.fsm.lock.Unlock() log.WithFields(log.Fields{ "Topic": "Peer", "Key": peer.ID(), "Families": families, }).Debug("deferral timer expired") - peer.fsm.lock.Unlock() } else if y && !c.MpGracefulRestart.State.EndOfRibReceived { log.WithFields(log.Fields{ "Topic": "Peer", |