From 0fac698dfc9696b7ca8d110c9b0af5199dd760e2 Mon Sep 17 00:00:00 2001 From: Gabi Date: Wed, 26 Jun 2024 18:25:00 -0300 Subject: [PATCH] chore(connlib): set connection expiration to 120seconds to respect the conntrack udp timeout (#5559) --- rust/connlib/tunnel/src/peer.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/connlib/tunnel/src/peer.rs b/rust/connlib/tunnel/src/peer.rs index e18cf4271..24ff086d9 100644 --- a/rust/connlib/tunnel/src/peer.rs +++ b/rust/connlib/tunnel/src/peer.rs @@ -273,7 +273,7 @@ impl ClientOnGateway { let expired_translations = self .permanent_translations .iter() - .filter(|(_, state)| state.no_response_in_30s(now) && state.is_used(now)); + .filter(|(_, state)| state.no_response_in_120s(now) && state.is_used(now)); let mut for_refresh = HashSet::new(); @@ -287,7 +287,7 @@ impl ClientOnGateway { .permanent_translations .values() .filter(|state| state.resource_id == resource_id && state.name == domain) - .all(|state| state.no_response_in_30s(now)) + .all(|state| state.no_response_in_120s(now)) { tracing::debug!(%domain, conn_id = %self.id, %resource_id, %resolved_ip, %proxy_ip, "Refreshing DNS"); @@ -585,8 +585,8 @@ impl TranslationState { now.duration_since(self.last_outgoing) <= Duration::from_secs(10) } - fn no_response_in_30s(&self, now: Instant) -> bool { - now.duration_since(self.last_incoming) >= Duration::from_secs(30) + fn no_response_in_120s(&self, now: Instant) -> bool { + now.duration_since(self.last_incoming) >= Duration::from_secs(120) } fn on_incoming_traffic(&mut self, now: Instant) {