test(http): atomically claim metrics phase expiry - #1225
Conversation
|
Two independent read-only reviews of the current PR head found no blocking concerns. The concurrency review checked the compare-and-exchange expiry decision, deadline replacement, equal-valued deadlines and the independent whole-trial timeout. The test/contract review checked deterministic ordering coverage, use of the same helper in the real supervisor, CMake registration and unchanged timeout budgets. Both confirmed that rebasing onto the merged WebSocket fixture change introduced no interaction. Focused normal/ASAN+UBSAN/TSAN regressions, all six verified TCP/TLS coordinates and the existing report/failure suites pass on this head. The historical cause of #1219 remains unproven; this PR closes only #1224. |
There was a problem hiding this comment.
🟢 Approval recommended
The atomic linearization point, timeout attribution, and deterministic coverage match the stated fixture contract.
Pull request overview
Prevents stale HTTP metrics phase deadlines from cancelling completed or replacement phases.
Changes:
- Adds atomic compare-and-exchange expiry claiming.
- Uses the helper in the metrics supervisor.
- Adds five deterministic regression tests and registers them.
File summaries
| File | Description |
|---|---|
tests/integration/http_metrics_supervision.hpp |
Defines atomic expiry claiming. |
tests/integration/http_streaming_metrics_server.cpp |
Applies atomic phase-timeout selection. |
tests/unit/test_http_metrics_supervision.cpp |
Covers deadline transition orderings and boundaries. |
tests/CMakeLists.txt |
Registers the new unit tests. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
Prevent the HTTP metrics supervisor from cancelling a completed or replacement
phase based on a stale deadline snapshot. Reading an atomic deadline and later
checking the clock was not an atomic expiry decision: the worker could clear
or replace that deadline between those operations.
Type of Change
Related Issues
Closes #1224
Related to #1219
This is authorized test maintenance of a personal open-source project. This
reachable fixture race is independently confirmed; it does not establish the
cause of #1219's historical TLS timeout, which remains under investigation.
Changes Made
Core Changes
is still current. A cleared or replaced snapshot cannot cancel later work.
decision used to select cancellation.
deadline replacement, inclusive expiry and disabled/unexpired deadlines.
API Changes and Compatibility
None. This changes test infrastructure only. The 10-second phase deadline,
5-second response-write budget and 60-second whole-trial deadline are unchanged.
No library API, migration, README, wiki or changelog change is applicable.
Testing
ASAN+UBSAN and TSAN (GCC 12.2, warnings as errors).
3 of the 5 cases; this is a controlled regression, not a recurrence of [Tests] Investigate intermittent HTTP TLS metrics timeout with partial-response evidence #1219.
tests and 3 failure scenarios, including genuine phase inactivity timeout).
attributable coordinates pass, with peer length/hash verification.
HTTP contracts/metrics, package consumer and CodeQL all pass. README-only
validation is intentionally skipped. Copilot and two independent reviews
have no blocking concerns; no unresolved review threads remain.
Full Debug CI: normal and ASAN each pass 1,304 cases on x64 / 1,303 on arm64.
TSAN passes 1,300 cases on x64 / 1,299 on arm64, with four existing explicit
skips per architecture. Full logs contain no sanitizer diagnostic.
Reproducible integration commands (using an out-of-source
BUILD_DIRwithTLS, HTTP and
ELIO_BUILD_HTTP_METRICSenabled):Unit filter:
[http][metrics][supervision], random seed1224.Transport results are diagnostic; they do not establish benchmark rankings.
Checklist
Reviewer Guidance
Check the linearization point between worker phase transitions and supervisor
expiry, the independent whole-trial deadline, and that the production fixture
uses the same helper exercised by the unit regressions. The helper tests force
the relevant operation ordering without relying on scheduler timing; the real
failure suite separately checks that genuine inactivity still fails.