Skip to content

Commit

Permalink
txHandler: do not drop accepted mgs (algorand#6257)
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy authored Feb 20, 2025
1 parent 5f12e1a commit 1d93b27
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions data/txHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,15 +631,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

0 comments on commit 1d93b27

Please sign in to comment.