feat: in-flight query coalescing with COALESCED path #20

Merged
razvandimescu merged 5 commits from feat/query-coalescing into main 2026-03-29 15:36:02 +08:00
razvandimescu commented 2026-03-29 13:55:34 +08:00 (Migrated from github.com)

Summary

  • When multiple queries for the same (domain, qtype) arrive concurrently and miss cache, only the first triggers recursive resolution — others wait on a broadcast channel
  • Followers log as COALESCED (not RECURSIVE) in the query log and dashboard
  • InflightGuard (Drop impl) guarantees map cleanup on panic/task cancellation
  • Extracted acquire_inflight() function so disposition logic is testable independently
  • Dashboard: purple COALESCED tag, recursive and coalesced in path filter dropdown
  • Stats API includes coalesced count

Test plan

  • 11 tests: InflightGuard cleanup (3), acquire_inflight disposition (5), concurrent handle_query integration (3)
  • All disposition tests call real acquire_inflight(), not tokio primitives
  • make all passes (fmt, clippy, audit, build, 108 tests)
  • Manual: verified COALESCED label in dashboard for concurrent queries

🤖 Generated with Claude Code

## Summary - When multiple queries for the same `(domain, qtype)` arrive concurrently and miss cache, only the first triggers recursive resolution — others wait on a broadcast channel - Followers log as `COALESCED` (not `RECURSIVE`) in the query log and dashboard - `InflightGuard` (Drop impl) guarantees map cleanup on panic/task cancellation - Extracted `acquire_inflight()` function so disposition logic is testable independently - Dashboard: purple `COALESCED` tag, `recursive` and `coalesced` in path filter dropdown - Stats API includes `coalesced` count ## Test plan - [x] 11 tests: InflightGuard cleanup (3), acquire_inflight disposition (5), concurrent handle_query integration (3) - [x] All disposition tests call real `acquire_inflight()`, not tokio primitives - [x] `make all` passes (fmt, clippy, audit, build, 108 tests) - [x] Manual: verified COALESCED label in dashboard for concurrent queries 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.