From 3ef57653c959ea8e855d16232e1a4cb28d2e43d4 Mon Sep 17 00:00:00 2001 From: "Bernd (Hermes)" Date: Fri, 24 Jul 2026 17:06:01 +0200 Subject: [PATCH] =?UTF-8?q?fix(B3):=20=5Fhoneymoon=5Fexpired=20Race-Schutz?= =?UTF-8?q?=20=E2=80=94=20pr=C3=BCft=20pending=5Fstatus=20unter=20Lock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/archivar/presence_engine.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/archivar/presence_engine.py b/plugin/archivar/presence_engine.py index 73b7fbf..4857e25 100644 --- a/plugin/archivar/presence_engine.py +++ b/plugin/archivar/presence_engine.py @@ -322,6 +322,17 @@ class PresenceEngine: active = self._active_tasks if active == 0: + # B3: Race-Schutz — prüfe ob pending_status 'busy' ist. + # mark_busy_started könnte parallel update_presence() mit + # pending='busy' aufgerufen haben. Dann NICHT überschreiben. + with self._coalesce_lock: + pending = self._pending_status + if pending == "busy": + logger.debug( + "[presence] Honeymoon-Timer abgelaufen, aber pending_status=busy — " + "nicht überschreiben (Race-Schutz)" + ) + return # B2: Reset _busy_started_at when honeymoon fully expires # and no active tasks remain — next busy cycle starts fresh. self._busy_started_at = 0.0