File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments