Skip to content

Commit

Permalink
Handle error in round robin.
Browse files Browse the repository at this point in the history
Fixes #151
Currently we cannot deliver same message to another peer cause it may be
already partially sent down the wire. So we just disconnect this peer
from the list and return an Err.
  • Loading branch information
Alexei-Kornienko committed Dec 26, 2021
1 parent 0a0337d commit 628594d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ impl GenericSocketBackend {
self.round_robin.push(next_peer_id.clone());
return Ok(next_peer_id);
}
Err(_) => {
panic!("Don't know how to handle this now");
Err(e) => {
self.peer_disconnected(&next_peer_id);
return Err(e.into());
}
};
}
Expand Down

0 comments on commit 628594d

Please sign in to comment.