mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
app/vminsert/netstorage: remove possible race condition when broken connection may be recovered before acquiring storageNode.bcLock
This commit is contained in:
parent
85036c2b07
commit
2fc2679a3f
1 changed files with 3 additions and 4 deletions
|
@ -185,13 +185,12 @@ func sendBufToReplicas(br *bufRows, snIdx, replicas int) bool {
|
|||
}
|
||||
|
||||
func (sn *storageNode) checkHealth() {
|
||||
if !sn.isBroken() {
|
||||
return
|
||||
}
|
||||
|
||||
sn.bcLock.Lock()
|
||||
defer sn.bcLock.Unlock()
|
||||
|
||||
if !sn.isBroken() {
|
||||
return
|
||||
}
|
||||
if sn.bc != nil {
|
||||
logger.Panicf("BUG: sn.bc must be nil when sn is broken; got %p", sn.bc)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue