Skip to content

Commit

Permalink
Split max_send_wait between max_send_wait_node_event && max_send_wait…
Browse files Browse the repository at this point in the history
…_network_event
  • Loading branch information
sydhds committed Oct 20, 2022
1 parent 1891607 commit b7e12dd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions massa-network-exports/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ pub struct NetworkConfig {
pub message_timeout: MassaTime,
/// Every `ask_peer_list_interval` in milliseconds we ask every one for its advertisable peers list.
pub ask_peer_list_interval: MassaTime,
/// Max wait time for sending a Network or Node event.
pub max_send_wait: MassaTime,
/// Max wait time for sending a Node event.
pub max_send_wait_node_event: MassaTime,
/// Max wait time for sending a Network event.
pub max_send_wait_network_event: MassaTime,
/// Time after which we forget a node
pub ban_timeout: MassaTime,
/// Timeout Duration when we send a `PeerList` in handshake
Expand Down
2 changes: 1 addition & 1 deletion massa-network-worker/src/network_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl NetworkWorker {

let (node_event_tx, node_event_rx) =
mpsc::channel::<NodeEvent>(cfg.node_event_channel_size);
let max_wait_event = cfg.max_send_wait.to_duration();
let max_wait_event = cfg.max_send_wait_network_event.to_duration();
NetworkWorker {
cfg,
self_node_id,
Expand Down
2 changes: 1 addition & 1 deletion massa-network-worker/src/node_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl NodeWorker {
&mut self.socket_reader,
&mut self.node_event_tx,
self.node_id,
self.cfg.max_send_wait,
self.cfg.max_send_wait_node_event,
)
.await
});
Expand Down
6 changes: 4 additions & 2 deletions massa-node/base_config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@
max_operations_per_message = 1024
# max number of endorsements per message
max_endorsements_per_message = 1024
# max milliseconds to wait while sending an event before dropping it
max_send_wait = 5_000
# max milliseconds to wait while sending a node event before dropping it
max_send_wait_node_event = 5_000
# max milliseconds to wait while sending a network event before dropping it
max_send_wait_network_event = 0
# we forget we banned a node after ban_timeout milliseconds
ban_timeout = 3600000
# Timeout duration when in handshake we respond with a PeerList
Expand Down
3 changes: 2 additions & 1 deletion massa-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ async fn launch(
peers_file_dump_interval: SETTINGS.network.peers_file_dump_interval,
message_timeout: SETTINGS.network.message_timeout,
ask_peer_list_interval: SETTINGS.network.ask_peer_list_interval,
max_send_wait: SETTINGS.network.max_send_wait,
max_send_wait_node_event: SETTINGS.network.max_send_wait_node_event,
max_send_wait_network_event: SETTINGS.network.max_send_wait_network_event,
ban_timeout: SETTINGS.network.ban_timeout,
peer_list_send_timeout: SETTINGS.network.peer_list_send_timeout,
max_in_connection_overflow: SETTINGS.network.max_in_connection_overflow,
Expand Down
3 changes: 2 additions & 1 deletion massa-node/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ pub struct NetworkSettings {
pub peers_file_dump_interval: MassaTime,
pub message_timeout: MassaTime,
pub ask_peer_list_interval: MassaTime,
pub max_send_wait: MassaTime,
pub max_send_wait_node_event: MassaTime,
pub max_send_wait_network_event: MassaTime,
pub ban_timeout: MassaTime,
pub peer_list_send_timeout: MassaTime,
pub max_in_connection_overflow: usize,
Expand Down

0 comments on commit b7e12dd

Please sign in to comment.