The initial upstream exchange ignored its supplied timeout and used hardcoded client limits. Bound each attempt with a context, copy the shared client for its timeout, and share the attempt budget with UDP-to-TCP fallback. Close private connections on cancellation to interrupt reads, and exclude caller cancellation from upstream failures so parallel losers remain healthy. The normal engine pipeline never applied server.timeouts.query, allowing failover to outlive the configured query budget. Apply a hot-reloaded overall context deadline at Handle while retaining earlier caller deadlines. Add silent UDP/TCP/TLS, cancellation, fallback, failover, and reload regressions. The server inflight test assumed receiving a TCP reply meant its sent counter had already been incremented. Wait for both completion counters before asserting them, preserving the existing assertions while removing the scheduling race.
This commit is contained in:
1 parent
32b214fac0
commit
340b4eaf80
6 files changed
+233
-10
No files matched your search
@@ -8,6 +8,25 @@ round before that brought the console onto the Go side of the API contract, so
|
||||
both halves of that are done. `AGENTS.md` holds the decisions, invariants and
|
||||
working rules; this file holds state and the plan.
|
||||
|
||||
## Timeout enforcement update
|
||||
|
||||
Foreground queries now enforce `server.timeouts.query` at `engine.Handle`,
|
||||
including all failover attempts. Reloads update the limit atomically; earlier
|
||||
caller deadlines and cancellation are preserved. `server.timeouts.upstream`
|
||||
bounds each complete upstream attempt, with UDP and its TCP truncation retry
|
||||
sharing one budget. Per-attempt client copies avoid mutating memoised clients,
|
||||
and cancellation closes the private connection to interrupt blocked reads.
|
||||
Caller cancellation (including parallel-race losers) does not degrade upstream
|
||||
health. An exhausted fallback budget returns an error; an immediate TCP failure
|
||||
still preserves the truncated UDP answer for the client to retry.
|
||||
|
||||
Regression tests cover silent UDP/TCP/TLS upstreams, active-read cancellation,
|
||||
fallback budgeting, failover, configured overall deadlines and hot reload.
|
||||
The observed transient `.local` search-expansion incident remains unexplained:
|
||||
these timeout defects bound stalls but do not establish why upstream replies
|
||||
were absent at the time. The orchestrator's absolute RabbitMQ hostname remains
|
||||
the independent search-expansion mitigation.
|
||||
|
||||
## Conditional forwarding update
|
||||
|
||||
`upstream.forward_zones` now routes an apex and its descendants to dedicated
|
||||
|
||||
Reference in new issue
Block a user