summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-03 12:26:54 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-03 13:17:37 +0900
commit10e68f5cba24663a5d562f86fabe65f17a4a49fd (patch)
tree43e66b994d2524001302741202126967941913f4 /server/server.go
parent46c766e594cd18263a855f198bb6921cb365d9dc (diff)
server: fix bgp state transition race
Make sure that all Go routines finishes before moving to another bgp state. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/server/server.go b/server/server.go
index d45e7bff..65253a70 100644
--- a/server/server.go
+++ b/server/server.go
@@ -24,7 +24,6 @@ import (
"github.com/osrg/gobgp/policy"
"github.com/osrg/gobgp/table"
zebra "github.com/osrg/gozebra"
- "gopkg.in/tomb.v2"
"net"
"os"
"strconv"
@@ -603,11 +602,6 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *fsmMsg, incoming chan *
case FSM_MSG_STATE_CHANGE:
nextState := e.MsgData.(bgp.FSMState)
oldState := bgp.FSMState(peer.conf.NeighborState.SessionState)
- go func(t *tomb.Tomb, addr string, oldState, newState bgp.FSMState) {
- e := time.AfterFunc(time.Second*30, func() { log.Fatal("failed to free the fsm.h.t for ", addr, oldState, newState) })
- t.Wait()
- e.Stop()
- }(&peer.fsm.h.t, peer.conf.NeighborConfig.NeighborAddress.String(), oldState, nextState)
peer.conf.NeighborState.SessionState = uint32(nextState)
peer.fsm.StateChange(nextState)
globalRib := server.localRibMap[GLOBAL_RIB_NAME]