mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
server: stop Shutdown() with no peer
After Shutdown() is called, the main goroutine waits for peers' goroutines to stop then dies. But if no peer is configured, the main goroutines never dies. Signed-off-by: FUJITA Tomonori <[email protected]>
This commit is contained in:
@@ -1144,6 +1144,10 @@ func (s *BgpServer) Shutdown() {
|
||||
for _, p := range s.neighborMap {
|
||||
p.fsm.adminStateCh <- stateOp
|
||||
}
|
||||
// the main goroutine waits for peers' goroutines to stop but if no peer is configured, needs to die immediately.
|
||||
if len(s.neighborMap) == 0 {
|
||||
os.Exit(0)
|
||||
}
|
||||
// TODO: call fsmincomingCh.Close()
|
||||
return nil
|
||||
}, false)
|
||||
|
||||
Reference in New Issue
Block a user