From 7353a004a8feb0510f5fabb59d571ba60cfa3054 Mon Sep 17 00:00:00 2001 From: "Lei, HUANG" Date: Thu, 23 Jul 2026 17:23:38 +0800 Subject: [PATCH] fix(mito2): dec inflight compaction gauge after re-entrancy guard DefaultNotifier::notify decremented INFLIGHT_COMPACTION_COUNT before the re-entrancy guard, so a duplicate notify (which should never happen, but the guard exists to defend against it) would decrement the gauge an extra time and let it drift negative. Move the decrement after the guard, matching the local compaction path's guard-then-account order. Signed-off-by: Lei, HUANG --- src/mito2/src/schedule/remote_job_scheduler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mito2/src/schedule/remote_job_scheduler.rs b/src/mito2/src/schedule/remote_job_scheduler.rs index 487b2c9365..9c71f887ba 100644 --- a/src/mito2/src/schedule/remote_job_scheduler.rs +++ b/src/mito2/src/schedule/remote_job_scheduler.rs @@ -160,7 +160,6 @@ impl DefaultNotifier { #[async_trait::async_trait] impl Notifier for DefaultNotifier { async fn notify(&self, result: RemoteJobResult, waiters: Vec) { - INFLIGHT_COMPACTION_COUNT.dec(); let Some(execution) = self .execution .lock() @@ -170,6 +169,7 @@ impl Notifier for DefaultNotifier { error!("Remote compaction notifier invoked more than once"); return; }; + INFLIGHT_COMPACTION_COUNT.dec(); match result { RemoteJobResult::CompactionJobResult(result) => { let notify = {