fix(rustproxy): Use cooperative cancellation for background tasks, prune stale caches and metric entries, and switch tests to dynamic port allocation to avoid port conflicts
This commit is contained in:
@@ -167,6 +167,14 @@ impl HttpProxyService {
|
||||
self.backend_tls_config = config;
|
||||
}
|
||||
|
||||
/// Prune caches for route IDs that are no longer active.
|
||||
/// Call after route updates to prevent unbounded growth.
|
||||
pub fn prune_stale_routes(&self, active_route_ids: &std::collections::HashSet<String>) {
|
||||
self.route_rate_limiters.retain(|k, _| active_route_ids.contains(k));
|
||||
self.regex_cache.clear();
|
||||
self.upstream_selector.reset_round_robin();
|
||||
}
|
||||
|
||||
/// Handle an incoming HTTP connection on a plain TCP stream.
|
||||
pub async fn handle_connection(
|
||||
self: Arc<Self>,
|
||||
|
||||
Reference in New Issue
Block a user