Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions data/txHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,15 +638,15 @@ func (handler *TxHandler) incomingMsgErlCheck(sender network.DisconnectableAddre
// is sufficient to indicate that we should enable Congestion Control, because
// an issue in vending capacity indicates the underlying resource (TXBacklog) is full
capguard, isCMEnabled, err = handler.erl.ConsumeCapacity(sender.(util.ErlClient))
if err != nil || // did ERL ask to enable congestion control?
(!isCMEnabled && congestedERL) { // is CM not currently enabled, but queue is congested?
if err != nil { // did ERL ask to enable congestion control?
handler.erl.EnableCongestionControl()
// if there is no capacity, it is the same as if we failed to put the item onto the backlog, so report such
transactionMessagesDroppedFromBacklog.Inc(nil)
return capguard, true
}
// if the backlog Queue has 50% of its buffer back, turn congestion control off
if !congestedERL {
} else if !isCMEnabled && congestedERL { // is CM not currently enabled, but queue is congested?
handler.erl.EnableCongestionControl()
} else if !congestedERL {
// if the backlog Queue has 50% of its buffer back, turn congestion control off
handler.erl.DisableCongestionControl()
}
}
Expand Down