Skip to content

Commit 1d93b27

Browse files
authored
txHandler: do not drop accepted mgs (#6257)
1 parent 5f12e1a commit 1d93b27

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

data/txHandler.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -631,15 +631,15 @@ func (handler *TxHandler) incomingMsgErlCheck(sender network.DisconnectableAddre
631631
// is sufficient to indicate that we should enable Congestion Control, because
632632
// an issue in vending capacity indicates the underlying resource (TXBacklog) is full
633633
capguard, isCMEnabled, err = handler.erl.ConsumeCapacity(sender.(util.ErlClient))
634-
if err != nil || // did ERL ask to enable congestion control?
635-
(!isCMEnabled && congestedERL) { // is CM not currently enabled, but queue is congested?
634+
if err != nil { // did ERL ask to enable congestion control?
636635
handler.erl.EnableCongestionControl()
637636
// if there is no capacity, it is the same as if we failed to put the item onto the backlog, so report such
638637
transactionMessagesDroppedFromBacklog.Inc(nil)
639638
return capguard, true
640-
}
641-
// if the backlog Queue has 50% of its buffer back, turn congestion control off
642-
if !congestedERL {
639+
} else if !isCMEnabled && congestedERL { // is CM not currently enabled, but queue is congested?
640+
handler.erl.EnableCongestionControl()
641+
} else if !congestedERL {
642+
// if the backlog Queue has 50% of its buffer back, turn congestion control off
643643
handler.erl.DisableCongestionControl()
644644
}
645645
}

0 commit comments

Comments
 (0)