fix(rustproxy-http): improve HTTP/3 connection reuse and clean up stale proxy state

This commit is contained in:
2026-03-26 07:05:57 +00:00
parent 437d1a3329
commit a3d8a3a388
14 changed files with 185 additions and 225 deletions

View File

@@ -363,6 +363,7 @@ impl RustProxy {
// Start the throughput sampling task with cooperative cancellation
let metrics = Arc::clone(&self.metrics);
let conn_tracker = self.listener_manager.as_ref().unwrap().conn_tracker().clone();
let http_proxy = self.listener_manager.as_ref().unwrap().http_proxy().clone();
let interval_ms = self.options.metrics.as_ref()
.and_then(|m| m.sample_interval_ms)
.unwrap_or(1000);
@@ -378,6 +379,9 @@ impl RustProxy {
metrics.sample_all();
// Periodically clean up stale rate-limit timestamp entries
conn_tracker.cleanup_stale_timestamps();
// Clean up expired rate limiter entries to prevent unbounded
// growth from unique IPs after traffic stops
http_proxy.cleanup_all_rate_limiters();
}
}
}