mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-21 07:41:28 +02:00
cdn_check and passive_ports run at the same level and both call ip_inventory.ensure(), which on a domain scan is the first thing to write ip_addresses — so both insert the same rows at the same moment. The row order came from a UNION with no ORDER BY, so the two statements could take row locks in different sequences and deadlock, failing a stage for no reason. Both inventories now insert in a deterministic key order. A failed facets request also overwrote the tab badge with 0, which reads as "this scan found nothing" rather than "the request failed". Only a successful response may restate the count now, in the Services and IPs tables alike. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BnC2xMMzV6WQnpDp5zcXoU