Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(workers): add io+timer drivers to tokio runtimes [fixes NET-795] #2135

Merged
merged 13 commits into from
Mar 7, 2024
3 changes: 2 additions & 1 deletion crates/created-swarm/src/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use server_config::{
UnresolvedConfig,
};
use tempfile::TempDir;
use test_constants::{EXECUTION_TIMEOUT, TRANSPORT_TIMEOUT};
use test_constants::{EXECUTION_TIMEOUT, IDLE_CONNECTION_TIMEOUT, TRANSPORT_TIMEOUT};
use tokio::sync::oneshot;
use toy_vms::EasyVM;
use tracing::{Instrument, Span};
Expand Down Expand Up @@ -403,6 +403,7 @@ pub async fn create_swarm_with_runtime<RT: AquaRuntime>(

resolved.node_config.aquavm_pool_size = config.pool_size.unwrap_or(1);
resolved.node_config.particle_execution_timeout = EXECUTION_TIMEOUT;
resolved.node_config.transport_config.connection_idle_timeout = IDLE_CONNECTION_TIMEOUT;

let allowed_effectors = config.allowed_effectors.iter().map(|(cid, binaries)| {
(Hash::from_string(cid).unwrap(), binaries.clone())
Expand Down
5 changes: 4 additions & 1 deletion crates/nox-tests/tests/workers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,14 @@ async fn test_resolve_subnet_on_worker() {
.unwrap();

let expected = {
let error = Value::Array(
let error = Value::Array(
vec![Value::String("error sending jsonrpc request: 'Networking or low-level protocol error: Server returned an error status code: 429'".to_string())]
);
let mut object_map = serde_json::Map::new();
object_map.insert("error".to_string(), error);
object_map.insert("success".to_string(), Value::Bool(false));
object_map.insert("workers".to_string(), Value::Array(vec![]));

vec![Value::Object(object_map)]
};

Expand Down
2 changes: 1 addition & 1 deletion crates/server-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn default_socket_timeout() -> Duration {
}

pub fn default_connection_idle_timeout() -> Duration {
Duration::from_secs(60)
Duration::from_secs(180)
gurinderu marked this conversation as resolved.
Show resolved Hide resolved
}

pub fn default_max_established_per_peer_limit() -> Option<u32> {
Expand Down
2 changes: 1 addition & 1 deletion crates/test-constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ pub static TIMEOUT: Duration = Duration::from_secs(15);

pub static SHORT_TIMEOUT: Duration = Duration::from_millis(300);
pub static TRANSPORT_TIMEOUT: Duration = Duration::from_millis(500);
pub static IDLE_CONNECTION_TIMEOUT: Duration = Duration::from_secs(30);
pub static IDLE_CONNECTION_TIMEOUT: Duration = Duration::from_secs(10);
pub static EXECUTION_TIMEOUT: Duration = Duration::from_millis(5000);
pub static PARTICLE_TTL: u32 = 20000;
Loading