diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 80e9f9854..6b4004b04 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2810,12 +2810,12 @@ dependencies = [ [[package]] name = "futures-bounded" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" +checksum = "b604752cefc5aa3ab98992a107a8bd99465d2825c1584e0b60cb6957b21e19d7" dependencies = [ - "futures-timer", "futures-util", + "tokio", ] [[package]] @@ -2887,12 +2887,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - [[package]] name = "futures-util" version = "0.3.31" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index b4de57be0..b4d32f525 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -85,7 +85,7 @@ firezone-telemetry = { path = "telemetry" } firezone-tunnel = { path = "connlib/tunnel" } flume = { version = "0.11.1", features = ["async"] } futures = { version = "0.3.31" } -futures-bounded = "0.2.1" +futures-bounded = "0.3.0" gat-lending-iterator = "0.1.6" glob = "0.3.3" hex = "0.4.3" diff --git a/rust/connlib/tunnel/Cargo.toml b/rust/connlib/tunnel/Cargo.toml index 6dbb17ead..d86708704 100644 --- a/rust/connlib/tunnel/Cargo.toml +++ b/rust/connlib/tunnel/Cargo.toml @@ -25,7 +25,7 @@ firezone-logging = { workspace = true } firezone-telemetry = { workspace = true } flume = { workspace = true, features = ["async"] } futures = { workspace = true } -futures-bounded = { workspace = true } +futures-bounded = { workspace = true, features = ["tokio"] } gat-lending-iterator = { workspace = true } glob = { workspace = true } hex = { workspace = true } diff --git a/rust/connlib/tunnel/src/io.rs b/rust/connlib/tunnel/src/io.rs index 24982efb6..90e720506 100644 --- a/rust/connlib/tunnel/src/io.rs +++ b/rust/connlib/tunnel/src/io.rs @@ -164,7 +164,10 @@ impl Io { reval_nameserver_interval: tokio::time::interval(RE_EVALUATE_NAMESERVER_INTERVAL), tcp_socket_factory, udp_socket_factory, - dns_queries: FuturesTupleSet::new(DNS_QUERY_TIMEOUT, 1000), + dns_queries: FuturesTupleSet::new( + || futures_bounded::Delay::tokio(DNS_QUERY_TIMEOUT), + 1000, + ), gso_queue: GsoQueue::new(), tun: Device::new(), udp_dns_server: Default::default(), @@ -381,7 +384,8 @@ impl Io { self.udp_socket_factory.reset(); self.sockets.rebind(self.udp_socket_factory.clone()); self.gso_queue.clear(); - self.dns_queries = FuturesTupleSet::new(DNS_QUERY_TIMEOUT, 1000); + self.dns_queries = + FuturesTupleSet::new(|| futures_bounded::Delay::tokio(DNS_QUERY_TIMEOUT), 1000); self.nameservers.evaluate(); } diff --git a/rust/connlib/tunnel/src/io/nameserver_set.rs b/rust/connlib/tunnel/src/io/nameserver_set.rs index 82e598f9d..b6c363d7d 100644 --- a/rust/connlib/tunnel/src/io/nameserver_set.rs +++ b/rust/connlib/tunnel/src/io/nameserver_set.rs @@ -42,7 +42,10 @@ impl NameserverSet { udp_socket_factory: Arc>, ) -> Self { Self { - queries: FuturesTupleSet::new(DNS_TIMEOUT, MAX_DNS_SERVERS), + queries: FuturesTupleSet::new( + || futures_bounded::Delay::tokio(DNS_TIMEOUT), + MAX_DNS_SERVERS, + ), inner, tcp_socket_factory, udp_socket_factory, diff --git a/rust/gateway/src/eventloop.rs b/rust/gateway/src/eventloop.rs index 82081ec44..be103d04c 100644 --- a/rust/gateway/src/eventloop.rs +++ b/rust/gateway/src/eventloop.rs @@ -99,7 +99,10 @@ impl Eventloop { tunnel: Some(tunnel), tun_device_manager, resolver, - resolve_tasks: futures_bounded::FuturesTupleSet::new(DNS_RESOLUTION_TIMEOUT, 1000), + resolve_tasks: futures_bounded::FuturesTupleSet::new( + || futures_bounded::Delay::tokio(DNS_RESOLUTION_TIMEOUT), + 1000, + ), logged_permission_denied: false, dns_cache: moka::future::Cache::builder() .name("DNS queries")