Skip to content

fix(h3): preserve pooled request trace context - #410

Merged
EdmondDantes merged 2 commits into
mainfrom
fix/352-pooled-h3-trace-context
Oct 6, 2026
Merged

EdmondDantes merged 2 commits into
mainfrom
fix/352-pooled-h3-trace-context

Conversation

@EdmondDantes

@EdmondDantes EdmondDantes commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Pooled HTTP/3 routes requests to a worker before the in-thread trace-context parser runs, leaving handler getters and access records without trace or span IDs. Prepare trace context, response compression and the JSON default through one shared helper in HTTP/1, HTTP/2, HTTP/3 and worker dispatch, using the dispatch thread's configuration. Preserve early H1/H2 parsing for WebSocket upgrades and avoid retaining valid trace headers twice.

Share the JSON-default response stub across parser/session unit tests and add an aborting stub for parser fuzz harnesses, which link the protocol helper without the response implementation.

Add a pooled HTTP/3 regression test that checks handler getters and access-log TraceId/SpanId for sampled and unsampled valid headers, uppercase and zero-ID headers, missing headers, and disabled telemetry.

Validation:

  • make -j4 passes.

  • The new test reproduces missing IDs on the previous module and passes after the fix, both with the reactor pool and with a temporary single-worker, pool-disabled variant.

  • Related HTTP/1 and HTTP/2 compression, HTTP/3 pool compression, JSON, trace-context and access-duration PHPT tests pass.

  • Rebuilt on current main and reran the regression and four related PHPT tests: all pass.

  • All 22 cmocka/CTest targets pass. Both HTTP/1 and HTTP/2 fuzz harnesses build and complete 100 seeded smoke iterations under ASan/UBSan.

Fixes #352.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Coverage

Total lines: 84.60% → 84.66% (+0.06 pp)

File Baseline Current Δ Touched
src/core/http_connection.c 83.67% 83.63% -0.04 pp ●
src/core/http_protocol_handlers.c 89.01% 89.80% +0.78 pp ●
src/core/worker_dispatch.c 83.50% 83.45% -0.04 pp ●
src/http2/http2_strategy.c 85.89% 85.85% -0.04 pp ●
src/http3/http3_dispatch.c 88.30% 88.37% +0.07 pp ●
src/http3/http3_listener.c 77.96% 77.66% -0.30 pp
src/http_request.c 85.76% 86.25% +0.49 pp
src/log/http_log.c 69.29% 70.45% +1.16 pp

@EdmondDantes
EdmondDantes merged commit 9e02e11 into main Oct 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pooled HTTP/3 requests lose their trace context

1 participant