From 1642b6efc4bdca5541f94ab8bb7ead16e66f313b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arma=C3=ABl=20Gu=C3=A9neau?= Date: Fri, 26 Apr 2024 13:11:25 +0200 Subject: [PATCH] add small comment --- src/https.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/https.rs b/src/https.rs index 20df354..ebdac6d 100644 --- a/src/https.rs +++ b/src/https.rs @@ -197,6 +197,10 @@ async fn handle_request( let tags = [host_tag, method_tag.clone()]; metrics.requests_received.add(1, &tags); metrics.requests_in_flight.add(1, &tags); + + // The guard ensures that we decrement requests_in_flight in all cases where + // the current tasks ends, including the case where it gets canceled and + // doesn't run to completion (which may happen e.g. if it timeouts). let _guard = InFlightGuard { metrics: Arc::clone(&metrics), tags: &tags,