node: Make sure all channels we use are bounded
This prevents potential memory leaks. We also ensure that sends fail instead of blocking, in case the channels are full.
Additionally, we add some metrics to report on channel size.
6 files changed
+72
-10
345ca923
→
5c0d1b10
modified radicle-node/src/runtime.rs
@@ -36,6 +36,9 @@ pub use handle::Error as HandleError;
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -214,7 +217,7 @@ impl Runtime {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle-node/src/runtime/handle.rs
@@ -347,6 +347,10 @@ impl radicle::node::Handle for Handle {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle-node/src/service.rs
@@ -117,7 +117,12 @@ pub use message::REF_REMOTE_LIMIT;
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -2559,8 +2564,10 @@ pub trait ServiceState {
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
| + | |
|
|
|
|
|
@@ -2603,6 +2610,10 @@ where
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle-node/src/wire/protocol.rs
@@ -300,6 +300,10 @@ impl Peers {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -504,6 +508,18 @@ where
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -761,8 +777,11 @@ where
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -1088,8 +1107,11 @@ where
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle-node/src/worker/channels.rs
@@ -9,6 +9,9 @@ use radicle::node::NodeId;
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -96,8 +99,8 @@ impl<T: AsRef<[u8]>> Channels<T> {
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
modified radicle/src/node/events.rs
@@ -14,6 +14,9 @@ use crate::node;
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -149,6 +152,7 @@ impl<T> Default for Emitter<T> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -158,10 +162,25 @@ impl<T: Clone> Emitter<T> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|