node/reactor: Correctly handle error events
fn handle_events would panic, if there were multiple events for one
token, and the first one that happened to be handled was an error.
Indeed it is concerning if a token is encountered that was never
registered before. However, tokens that were just deregistered must be
tracked.
Using Vec here seems a bit costly, in the future,
smallvec::SmallVec could be considered.
The “unregister” methods are renamed to “deregister” to better line up
with mio vocabulary.
Log stamtements that helped analysis of the panic that occurred here
is overhauled and improved, requiring a Debug bound on types that
obviously implement it.
5 files changed
+57
-40
72cf3d19
→
0b342485
modified crates/radicle-node/src/reactor.rs
@@ -203,13 +203,13 @@ pub trait ReactionHandler: Send + Iterator<Item = Action<Self::Listener, Self::T
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -428,50 +428,60 @@ impl<H: ReactionHandler> Runtime<H> {
|
|
|
|
|
|
| + | |
|
|
| + | |
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
| - | |
| - | |
| + | |
| + | |
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
| - | |
| + | |
| + | |
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -498,7 +508,7 @@ impl<H: ReactionHandler> Runtime<H> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -520,33 +530,33 @@ impl<H: ReactionHandler> Runtime<H> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -562,27 +572,27 @@ impl<H: ReactionHandler> Runtime<H> {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-node/src/reactor/session.rs
@@ -100,7 +100,7 @@ impl<M: StateMachine, S: Session> Display for ProtocolArtifact<M, S> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-node/src/runtime.rs
@@ -1,6 +1,7 @@
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -131,7 +132,11 @@ impl Runtime {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified crates/radicle-node/src/test/node.rs
@@ -1,3 +1,4 @@
| + | |
|
|
|
|
|
@@ -455,7 +456,7 @@ impl Node<MockSigner> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-node/src/wire.rs
@@ -3,6 +3,7 @@
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -490,7 +491,7 @@ impl<D, S, G> reactor::ReactionHandler for Wire<D, S, G>
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|