Skip to content

Restore Uranium coverage found in backport review - #13914

Merged
bneradt merged 2 commits into
apache:masterfrom
bneradt:fix-uranium-review-parity
Oct 26, 2026
Merged

bneradt merged 2 commits into
apache:masterfrom
bneradt:fix-uranium-review-parity

Conversation

@bneradt

@bneradt bneradt commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Review of the Uranium backports (#13889 and #13892) found gaps on master:
some replay values did not enable verification, and some converted tests
no longer exercised the original body, framing, or lifecycle assertions.
Leaving those corrections only on release branches would make master
less thoroughly tested than the supported releases.

This patch restores explicit replay assertions and original protocol
semantics, including independent Lua client sessions, length synthesis,
complete large-response checksums, and TLS hook counts. A focused guard
protects the audited manifests and their external replay dependencies.

The accompanying HTTP/2 production fix preserves addresses during
session-close hooks. The strengthened continuation regression exposed
that shared issue, so this PR includes the fix as well as the tests.

Co-authored-by: GPT-6 Astra Medium

bneradt added 2 commits October 26, 2026 12:32
HTTP/2 session destruction closes its network connection before invoking
session-close hooks. The session address APIs then return null or stale
endpoints, preventing plugins from inspecting the completed connection.

This patch caches both socket endpoints and the effective client address
before closing the connection. The close-hook regression compares the
numeric addresses and ports with their session-start values, including
the effective address supplied through PROXY protocol.

Co-authored-by: GPT-6 Astra Medium
Review of the Uranium backports (apache#13889 and apache#13892) found gaps on master:
some replay values did not enable verification, and some converted tests
no longer exercised the original body, framing, or lifecycle assertions.
Leaving those corrections only on release branches would make master
less thoroughly tested than the supported releases.

This patch restores explicit replay assertions and original protocol
semantics, including independent Lua client sessions, length synthesis,
complete large-response checksums, and TLS hook counts. A focused guard
protects the audited manifests and their external replay dependencies.

The accompanying HTTP/2 production fix preserves addresses during
session-close hooks. The strengthened continuation regression exposed
that shared issue, so this PR includes the fix as well as the tests.

Co-authored-by: GPT-6 Astra Medium
Copilot AI balanced review requested due to automatic review settings October 26, 2026 17:34
@bneradt bneradt added this to the 11.0.0 milestone Oct 26, 2026
@bneradt bneradt self-assigned this Oct 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@bneradt

bneradt commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Local verification passed: 75 focused Uranium cases with eight workers (one HTTP/3 capability skip), all 110 framework tests, and 38 relevant CTest cases. The full build/install and format target also passed. Shared review corrections are now present in the updated release backports #13889 and #13892 as applicable; release-specific configuration and protocol differences remain intact.

bneradt pushed a commit to bneradt/trafficserver that referenced this pull request Oct 26, 2026
Malformed HTTP/2 requests can race connection shutdown before the
client finishes writing. On 9.2, rejecting negative Content-Length
headers can also legitimately close a stream before queued DATA arrives.

This patch brings in the client synchronization from apache#13914 and isolates
validation cases so the expected closed-stream diagnostic is allowed
only for the negative-length rejection. Valid requests still reject all
error diagnostics, and malformed cases retain their rejection checks.

Co-authored-by: GPT-6 Astra Medium

@bryancall bryancall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approve

Nice fix.

Verified: red without it, green with it

On eris the continuation test aborts on h2 and h2-proxy with the three assign() lines removed, and passes 5 of 5 with them. Caching the plain remote address instead fails only h2-proxy, so the PROXY path is covered. The replay guard also caught a bare header value when I put one back.

Non-blocking

  • The guard still passes a rule with no as, like {value: bar}, and a two-element URL item like [path, "/cookieexists"]. Nothing uses either today.
  • tls_hook_request() now checks only the exit code, and curl exits 0 on a 502. The old gold files required empty stdout.
  • cache-control-basic.test.yaml has two "Test 6" headers.
  • HTTP/1 has the same gap: Http1ClientSession::do_io_close() nulls _vc before destroy() runs the SSN_CLOSE hooks. That's worth a follow-up issue rather than more scope here.

@bneradt
bneradt merged commit 69346b7 into apache:master Oct 26, 2026
14 checks passed
@bneradt
bneradt deleted the fix-uranium-review-parity branch October 26, 2026 20:41
bneradt pushed a commit to bneradt/trafficserver that referenced this pull request Oct 26, 2026
Malformed HTTP/2 requests can race connection shutdown before the
client finishes writing. On 9.2, rejecting negative Content-Length
headers can also legitimately close a stream before queued DATA arrives.

This patch brings in the client synchronization from apache#13914 and isolates
validation cases so the expected closed-stream diagnostic is allowed
only for the negative-length rejection. Valid requests still reject all
error diagnostics, and malformed cases retain their rejection checks.

Co-authored-by: GPT-6 Astra Medium
bneradt pushed a commit to bneradt/trafficserver that referenced this pull request Oct 27, 2026
Malformed HTTP/2 requests can race connection shutdown before the
client finishes writing. On 9.2, rejecting negative Content-Length
headers can also legitimately close a stream before queued DATA arrives.

This patch brings in the client synchronization from apache#13914 and isolates
validation cases so the expected closed-stream diagnostic is allowed
only for the negative-length rejection. Valid requests still reject all
error diagnostics, and malformed cases retain their rejection checks.

Co-authored-by: GPT-6 Astra Medium
bneradt added a commit that referenced this pull request Oct 27, 2026
* Close HTTP/2 sockets before session hooks

HTTP/2 peer shutdown can deliver VC_EVENT_EOS while a session-close
hook waits for its mutex. The API callback handler rejects that network
event and aborts the proxy. Running the converted Uranium lifecycle
test repeatedly exposed this pre-existing 9.2 production race.

This patch applies the socket close ordering already used by master
(#9366), closing network I/O before invoking session-close hooks. It
caches both socket endpoints first so close-hook address APIs retain
valid addresses and ports after the connection is released. The
converted lifecycle tests check hook ordering and endpoint preservation.

Co-authored-by: GPT-6 Astra Medium

* Backport client certificate context updates

The converted cert_update test exposes an existing 9.2 production bug:
TSSslClientCertUpdate searches with a certificate-and-key pair although
the context map uses the certificate path. The original AuTest reported
false success because its lowercase Streams.all assignments registered
no assertions, so certificate replacement failures went unnoticed.

This patch backports the fix from #13576, updating every matching CA
bucket, invalidating cached certificate data, preserving live contexts
on replacement failure, and releasing the acquired SSL configuration.
The separate Uranium migration verifies certificate subjects before and
after replacement and retains the working context after an invalid PEM.
This production prerequisite lets that coverage run without hiding the
defect behind a skip or an expected failure.

Co-authored-by: GPT-6 Astra Medium

* Backport Uranium tests to 9.2.x

The supported 9.2 branch still depends on AuTest after master moved to
pytest-based Uranium. Maintaining separate test frameworks makes new
regressions harder to backport and leaves branch-specific coverage
dependent on the old runner.

This patch migrates the existing scenarios to self-contained replay
tests and fixture-driven pytest functions while preserving 9.2 behavior.
The shared harness supports Autotools, records.config, and managed
configuration reloads, with API documentation and source-distribution
assets. The configured wrapper also includes the Bash 3 empty-array fix
from #13884.

Two separate production prerequisites fix defects exposed by the tests.
The socket-close ordering fix from #9366 prevents HTTP/2 network events
from reaching a pending session-close hook and aborting the proxy. The
client-certificate update fix from #13576 corrects context lookup and
replacement; the old AuTest's unregistered output assertions had hidden
its failure. These fixes let the converted tests retain their intended
coverage rather than skipping or accepting the broken behavior.

Co-authored-by: GPT-6 Astra Medium

* Fix Uranium in-source build checks

In-source configuration overwrote the tracked Uranium launcher, causing
CI's formatting clean-tree check to fail. RAT also treated the generated
Python dependency lockfile as an unlicensed source file.

This patch preserves the source launcher and delegates configured runs
to a separate generated wrapper, with regression coverage for argument
forwarding. It also includes the launcher in source distributions and
excludes the generated lockfile from license scanning.

Co-authored-by: GPT-6 Astra Medium

* Isolate nested Uranium test sandboxes

An exported sandbox path makes the collision-diagnostic self-test reuse
the enclosing pytest session's locked sandbox, preventing the intended
collection diagnostic from running.

This patch gives the child session an explicit private sandbox and
exercises both serial and parallel collection with an inherited, locked
parent sandbox. The shared-sandbox safety lock remains unchanged.

Co-authored-by: GPT-6 Astra Medium

* Synchronize HTTP/2 validation requests

Malformed HTTP/2 requests can race connection shutdown before the
client finishes writing. On 9.2, rejecting negative Content-Length
headers can also legitimately close a stream before queued DATA arrives.

This patch brings in the client synchronization from #13914 and isolates
validation cases so the expected closed-stream diagnostic is allowed
only for the negative-length rejection. Valid requests still reject all
error diagnostics, and malformed cases retain their rejection checks.

Co-authored-by: GPT-6 Astra Medium

---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants