Fix panic (#5654)
This commit is contained in:
@@ -373,8 +373,10 @@ func (ms *MasterServer) deleteClient(clientName string) {
|
|||||||
glog.V(0).Infof("- client %v", clientName)
|
glog.V(0).Infof("- client %v", clientName)
|
||||||
ms.clientChansLock.Lock()
|
ms.clientChansLock.Lock()
|
||||||
// close message chan, so that the KeepConnected go routine can exit
|
// close message chan, so that the KeepConnected go routine can exit
|
||||||
close(ms.clientChans[clientName])
|
if clientChan, ok := ms.clientChans[clientName]; ok {
|
||||||
delete(ms.clientChans, clientName)
|
close(clientChan)
|
||||||
|
delete(ms.clientChans, clientName)
|
||||||
|
}
|
||||||
ms.clientChansLock.Unlock()
|
ms.clientChansLock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user