You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(post-review): H1-H4 + C1 from deep code review (#56)
- C1 / H1 (mcp/server.go): tools/call concurrency gate refactored to use
an explicit `acquired` flag so the dead `break` inside select{default}
is gone. The semaphore slot is now held until the inner goroutine
finishes — not when the request thread gives up on timeout. Without
this, slow handlers could keep accumulating goroutines past the cap.
Added TestRobustness_TimeoutHoldsSemaphoreSlot to lock in the new
ordering contract.
- H2 (tsdb/aggregator.go): droppedBatches changed to atomic.Int64.
Previously a plain int64 was incremented in flush() (after the unlock)
and read concurrently by DroppedBatches() from telemetry scrape paths.
No test surfaced it because no scrape ran during a flush; live
Prometheus would have.
- H3 (storage): FTS5→LIKE fallback now logs slog.Warn with tenant +
query + error so the operator notices instead of leaving the seatbelt
on. Applied to both SearchLogs and GetLogsV2.
- H4 (storage/partitions_scheduler.go): documented the one-shot
lifecycle. Start-Stop-Start is NOT supported because Stop closes the
internal `done` channel; restarts must construct a fresh scheduler.
Reverted: H5 and H6 from the review conflict with existing test contracts
(TestPipeline_DefaultsApplied requires SoftThreshold zero-value to be
treated as "use default"; TestPipeline_FailedSpansSkipsLogs enforces
"orphan logs are not persisted without their spans"). Kept the existing
behaviour and added comments explaining it so future reviewers don't
re-flag the same items.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments