Skip to content

Commit

Permalink
Stop processing the request after failing an overloaded connection
Browse files Browse the repository at this point in the history
zebra-network's Connection expects that `fail_with` is only called once
per connection, but the overload handling code continues to process the
current request after an overload error, potentially leading to further
failures.

Closes #1599
  • Loading branch information
teor2345 authored and dconnolly committed Jan 18, 2021
1 parent 3a093cc commit 44c8faf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions zebra-network/src/peer/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ where
if self.svc.ready_and().await.is_err() {
// Treat all service readiness errors as Overloaded
self.fail_with(PeerError::Overloaded);
return;
}

let rsp = match self.svc.call(req).await {
Expand Down

0 comments on commit 44c8faf

Please sign in to comment.