From fc855f52f9a85d8be9e08854950876993878a3b1 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Wed, 22 Apr 2026 13:25:28 +0200 Subject: [PATCH] fix(batch-dedup): don't crash on FK violation in _write_review Stale UUIDs in the Qdrant dedup collection can reference controls that were deprecated in earlier batches. Log warning and continue instead of raising and killing the entire job. Co-Authored-By: Claude Opus 4.6 (1M context) --- control-pipeline/services/batch_dedup_runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/control-pipeline/services/batch_dedup_runner.py b/control-pipeline/services/batch_dedup_runner.py index 715cf27..e305e2a 100644 --- a/control-pipeline/services/batch_dedup_runner.py +++ b/control-pipeline/services/batch_dedup_runner.py @@ -606,9 +606,9 @@ class BatchDedupRunner: }) self.db.commit() except Exception as e: - logger.error("BatchDedup _write_review error: %s", e) + logger.warning("BatchDedup _write_review skipped (FK or other error): %s", e) self.db.rollback() - raise + self.stats["errors"] += 1 # ── Progress ─────────────────────────────────────────────────────────