Fix issue not reported when load decrement is incorrect (#15061)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
fzyzcjy
2025-12-14 13:17:35 +08:00
committed by GitHub
parent 74ea45cc4b
commit 681c68cfbf

View File

@@ -649,11 +649,18 @@ impl Worker for BasicWorker {
}
fn decrement_load(&self) {
self.load_counter
if self
.load_counter
.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |current| {
current.checked_sub(1)
})
.ok();
.is_err()
{
tracing::warn!(
worker_url = %self.metadata.url,
"Attempted to decrement load counter that is already at 0"
);
}
self.update_running_requests_metrics();
}