Skip to content

Cherry-picks for 10.2.0 RC, round 5 (2026-08-10) - #13526

Merged
cmcfarlen merged 3 commits into
apache:10.2.xfrom
cmcfarlen:10.2.x-picks-20260810b
Aug 10, 2026
Merged

cmcfarlen merged 3 commits into
apache:10.2.xfrom
cmcfarlen:10.2.x-picks-20260810b

Conversation

@cmcfarlen

Copy link
Copy Markdown
Contributor

Fifth round of cherry-picks for the 10.2.0 release candidate, covering the PRs at "For v10.2.0" in the ATS v10.2.x project.

All picked with git cherry-pick -x in master merge order; every pick applied cleanly with no conflicts, and each commit's diffstat matches its master commit exactly.

PR Title
#13517 Bound RegexMatches::operator[] by what the match populated
#13352 prefetch: don't drop replacements for non-participating optional capture groups
#13523 Shut the client read side down per transaction, not per connection

Merge order is load-bearing here even though no files overlap. #13352's replace() relies on matches[replIndex] returning a non-null view for a capture group inside the match count that did not participate:

std::string_view dst = (replIndex < matchCount) ? matches[replIndex] : std::string_view{""};
PrefetchDebug("replacing '$%d' with '%.*s'", replIndex, static_cast<int>(dst.length()), dst.data());

The "" there covers only the out-of-range branch. The non-participating-but-in-range case is what #13517 fixes centrally, by returning "" instead of a default-constructed std::string_view from RegexMatches::operator[]. #13441 — already on this branch — introduced that null-data() return, so picking #13352 without #13517 first would leave a null pointer reaching "%.*s" and std::string::append. #13517 merged four minutes before #13352 upstream, so master merge order gives the correct sequence.

#13523 completes the other half of #12529: state_watch_for_client_abort reached past the transaction to the shared NetVConnection to half-close the client read side, which for HTTP/2 and HTTP/3 stopped the whole session from reading frames for every other stream. #12529 converted the two branches it touched but left the pre-existing IO_SHUTDOWN_READ call, and HttpSM.cc was the only site in the tree still doing that.

Verified before pushing: every Disk.* attribute, Test.* helper and Condition.* used by the new tests exists on this branch — including Test.AddAwaitFileContainsTestRun and Condition.HasProxyVerifierVersion('2.8.0'), which this branch satisfies since it pins Proxy Verifier v3.1.3 — and all eight proxy.config.* records the new tests reference resolve in RecordsConfig.cc. No picked test reaches for a master-only config idiom (ssl_multicert_yaml or storage_yaml).

Local build is clean and ctest is 167/167. cmake --build ... --target format makes no changes.

Draft so the full CI matrix runs against the picked set before the release branch moves; it will be landed by fast-forward.

moonchen and others added 3 commits August 10, 2026 11:50
)

The ovector holds a fixed number of pairs regardless of the pattern,
but pcre2_match() writes no further than the highest participating
group. Indexing past that read the uninitialized remainder of the
internal buffer and built a view from it, so checking PCRE2_UNSET was
not by itself enough.

Bound the index by the match size instead, and return an empty view
built from "" rather than a default-constructed one. Callers pass the
result straight to memcpy(), std::string::append() and "%.*s", none of
which accept a null pointer.

(cherry picked from commit 985642e)
…ure groups (apache#13352)

Pattern::replace() rejected any $N whose index was >= the match's
return value. That value is one past the highest capture group that
*participated*, not the number of groups the pattern defines, so a
trailing optional group such as "(\?.*)?" that did not participate made
a valid $N look out of range.  Every such request logged "invalid
reference in replacement string" and silently dropped the prefetch.

Validate $N once at config-load time against the pattern's actual
capture-group count, and substitute an empty string at match time for
a group that did not participate, per PCRE2 semantics.

Also treat an unusable --fetch-path-pattern and invalid --fetch-count
/ --fetch-max / --fetch-overflow values as configuration errors, so
the remap rule is refused at load rather than running with prefetch
silently disabled. --fetch-count and --fetch-max now parse with
std::from_chars(), which rejects a value above UINT_MAX instead of
truncating it. Skip an empty expanded path rather than self-
prefetching the original, and report that once per remap instance
since the condition is request-dependent.

Removes the now-dead Pattern::process() and Pattern::capture().

(cherry picked from commit adbd85d)
…pache#13523)

HttpSM::state_watch_for_client_abort reached past the transaction to
_ua.get_txn()->get_netvc() to half close the client read side on an early
EOS. For HTTP/2 and HTTP/3 that NetVConnection is shared by every stream
on the connection, so a single aborted stream stopped the session from
reading frames for all of the others. Route the shutdown through the
transaction instead: Http2Stream and HQTransaction already implement
do_io_shutdown() as a deliberate no-op for exactly this reason, and
HTTP/1.x is unaffected because ProxyTransaction forwards to the session's
NetVConnection.

This is the remaining half of apache#12529. That change was written to address
two regressions from apache#12502, the second being "HTTP/2 connection is
closed if a stream is reset even if other streams are alive", with the
stated approach of calling ProxyTransaction::do_io_shutdown() instead of
NetVConnection::do_io_shutdown(). It converted the two branches it added
but left the pre-existing IO_SHUTDOWN_READ branch calling the
NetVConnection directly, so the connection-wide shutdown survived for the
case where the tunnel still has a consumer besides the client. A response
transform reaches that case readily: the transform stage runs the whole
body before anything is written back, so the stream has no write of its
own and a client reset arrives as an EOS on the stream's read VIO.

Clearing the session's read VIO buffer is not inert, because
Http2CommonSession still holds that VIO and re-enables it every 128
frames through HTTP2_SESSION_EVENT_REENABLE. A release build then takes
the ntodo() <= 0 path in net_read_io and the connection stalls silently,
failing every in-flight stream; a debug build aborts on
SSLNetVConnection's `ink_assert(buf.writer())`, the assertion reported
in apache#9448.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 31eb68f)
@cmcfarlen
cmcfarlen merged commit 34a0030 into apache:10.2.x Aug 10, 2026
15 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.

3 participants