feat(healing): re-check membership mismatches before healing

A decision created moments before an audit shows up as missing=1 until
the bouncer's next poll, which triggered a bouncer restart for nothing.

When the audit finds a membership mismatch, wait membership_recheck_delay
seconds (default 30, 0 disables) and audit again; only drift that is still
present is reported and healed. Metadata drift is not delayed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Opus 5.5 committed 2026-10-13 19:38:39 -04:00
1 parent 79f72512e4
commit 772892b78d
7 files changed
+100 -3

No files matched your search

+10 -2
View File
@@ -11,7 +11,7 @@ except ImportError:
from auditor import FirewallAuditor
from config import load_runtime_settings, setup_logging, validate_runtime_settings
from healing import execute_heal_and_verify, should_heal
from healing import execute_heal_and_verify, recheck_membership_mismatch, should_heal
from reporter import LocalStateReporter
@@ -54,6 +54,7 @@ def main():
f"check_jitter_pct={settings.check_jitter_pct:.2f} "
f"heal_verify_delay={settings.heal_verify_delay}s "
f"heal_min_interval={settings.heal_min_interval}s "
f"membership_recheck_delay={settings.membership_recheck_delay}s "
f"state_file={settings.state_file} "
f"targets=[{targets_desc}] "
f"sets_mode={sets_mode} sets=[{sets_desc}]"
@@ -88,7 +89,14 @@ def main():
while not stop_event.is_set():
try:
is_synced, count, drift = auditor.reconcile()
is_synced, count, drift = recheck_membership_mismatch(
auditor,
auditor.reconcile(),
settings.membership_recheck_delay,
wait=stop_event.wait,
)
if stop_event.is_set():
break
reporter.update_status(
is_synced,
count,