Skip to content

Pick up more master branch commits to 10.2.x for 10.2.0 - #13446

Draft
cmcfarlen wants to merge 33 commits into
apache:10.2.xfrom
cmcfarlen:10.2.x-backport-jul2026
Draft

Pick up more master branch commits to 10.2.x for 10.2.0#13446
cmcfarlen wants to merge 33 commits into
apache:10.2.xfrom
cmcfarlen:10.2.x-backport-jul2026

Conversation

@cmcfarlen

Copy link
Copy Markdown
Contributor

Draft — CI verification only, do not merge

Backward-compatible commits cherry-picked from master since #13224, targeting the
10.2.0 release. Scope: bugfixes, cleanup, low-risk self-contained features, and
test/doc improvements. Excludes any PR labeled Incompatible and any large new
feature. Security fixes tracked in the separate "Release 2" (#13442) are intentionally
not included here — those are picked separately.

33 PRs picked (all clean cherry-picks, -x); full build is green and unit tests
pass (one pre-existing macOS-local test_jsonrpcserver socket-path failure, unrelated).

Deferred:

Already on 10.2.x from the #13224 catchup (bookkeeping only, no commit here): #13195, #13252.

If CI is green, the individual PRs will be added to the ATS v10.2.x project and the
10.2.0 milestone.

traeak and others added 30 commits July 28, 2026 20:17
* add bypass header config option to maxmind_acl plugin

* fix for header value check, update docs with warning about usage of this new feature

* require both header and value. clean up review suggestions

* more explicit documentation about value match, limit debug log

* maxmind: tighten up checks on yaml node

(cherry picked from commit f891fe9)
* Clamp HTTP3 frame type buf size to reader bytes

The length of the source buffer for HTTP3 type parsing was always taken
to be the maximum length of the type field. This seemed to work without
UB when I tested it through `Http3FrameDispatcher`, but Kit Chan pointed
out that it is risky (apache#11720).

This patch refactors the type parsing to guarantee that the number of
bytes passed to the parser will not be greater than the number of
initialized bytes in the buffer.

* Fix incorrect identifier name

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fix incorrect identifier

* Fix incorrect identifier name

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit 3189423)
* slice: fix stpcpy off-by-one for header value extraction

The off by one wastes a single character, it doesn't overrun.

* HttpHeader: check for pass in zero length value

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit b71ea74)
* Move `dir_init_segment` to `Directory`

* Move `dir_init_segment` to `Directory`

* Move `dir_bucket_loop_fix` to `Directory`

* Move `unlink_from_freelist` to `Directory`

* Move `dir_delete_entry` to `Directory`

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit 0847dc6)
In earlier work, `vol` was renamed to `stripe` throughout the cache.
A few occurences of `vol` were missed because they are conditionally compiled.
This patch renames `vol` to `stripe` within code switched by the
`LOOP_CHECK_MODE` definition.

(cherry picked from commit 77253da)
…3258)

TSHttpTxnClientReqGet was not paired with TSHandleMLocRelease, unlike
every other call site in this file. The handle is a top-level
HTTP_HEADER mloc so the release is effectively a no-op today, but
matching the documented API contract avoids surprises if the SDK
implementation ever changes.

(cherry picked from commit e79182f)
This removes the following members:
- EThread::diskHandler
- EThread::aio_ops

(cherry picked from commit a2e02e1)
Cache headers transitively pull in <ts/ats_probe.h> via P_CacheDir.h.
When ENABLE_PROBES=ON, ENABLE_SYSTEMTAP_PROBES is defined and
ats_probe.h `#include <sys/sdt.h>`. tsapi's include path didn't have
lib/systemtap, so the build failed.

Mirror what tscore already does (src/tscore/CMakeLists.txt:110), gated
on ENABLE_PROBES so the dependency only attaches when probes are
actually enabled.

(cherry picked from commit 52a124b)
Fixes apache#1570.

This removes the unused `ConstBuffer` class. The header was not
included anywhere. The only mention of `ConstBuffer` in the docs
is in the history of `TextView`. Therefore, that mention has
been preserved.

(cherry picked from commit 1a10d12)
Clang 22 treats the ignored std::unordered_map::find result in the
txn_box unit perf test as a warning, and the project builds with
warnings promoted to errors. The test therefore fails to compile even
though the lookup is intentionally only being timed.

This explicitly discards the lookup result in the benchmark lambda and
corrects the printed label to describe the lookup operation.

(cherry picked from commit 309d832)
* Add unit tests for `Continuation` logic

This change was generated by Claude Opus 4.7 from API contracts I have not yet
opened PRs for. It does not touch existing files other than one CMakeLists.txt,
so it is low-risk.

I reviewed each test case and they are good. I have not reviewed code semantics
carefully for correctness. The default delay for the `CountingContinuation` wait
is five seconds; I think a wait with a timeout is an acceptable way to test
this, and five seconds should be plenty. If an event scheduled to run immediately
doesn't call back the associated continuation within five seconds, that's
probably unacceptable performance and worth failing the test for. :D

(cherry picked from commit a344dec)
Plugin code that protects small critical sections with TSMutex has to pair
every early return with a matching unlock. That pattern is easy to get wrong
and makes the intended lock lifetime harder to see.

This adds a small TSMutexLockGuard helper to the plugin API and uses it in
plugin code where the mutex naturally stays locked until a return path.

(cherry picked from commit 094c755)
…13209)

The redo_cache_lookup plugin kept the fallback URL as a pointer into
the plugin.config argv storage. That storage can be released after
plugin initialization, leaving cache-lookup-complete callbacks to
dereference stale memory.

This copies the parsed fallback URL into plugin-owned storage and
passes its owned bytes to TSHttpTxnRedoCacheLookup.

Also, while investigating this, it looks like this plugin was made
simply to demonstrate the use of TSHttpTxnRedoCacheLookup rather than
being a production-useful plugin. The initial commit says as much and
there is no customer-facing documentation for this plugin. As such, I'm
moving this to the examples plugin.

(cherry picked from commit 468e764)
* Update FastLZ to b1342da

* Add copyright to the NOTICE

(cherry picked from commit 9ebcdd2)
This removes the Catch2 listener from test_EventSystem.cc, using
the identical listener from inkevent_test_fixtures.h instead.

There is a similar listener in the IOBuffer test, but it is not an
exact duplicate (it calls `LibRecordsConfigInit`).

(cherry picked from commit bd785f4)
Malformed client HTTP/2 streams can produce noisy error-level
diagnostics even though the malformed parse details are now available
in transaction logs via apache#13059.

This downgrades the inbound rcv_frame stream-error diagnostic to
Http2StreamDebug while leaving outbound stream creation errors at Error
level. This also updates the malformed request AuTest to look for the
debug diagnostic in traffic.out and relies on Http2StreamDebug to include
the session and stream identifiers.

(cherry picked from commit 87cf5ec)
Give the FORCE_SIE test mode its own enum value so the stale-if-error rows are not aliases of FORCE_SWR. Add a load-time guard to catch future duplicate OptionType values before the autest runs.

(cherry picked from commit 9fe25ce)
Describe what cancel_pending_action() does in the Coverity suppression rationale. The helper cancels pending cache work and clears tracked pointers rather than only setting flags.

(cherry picked from commit 00adbb8)
* docs: add call condition note for TSUrlHostGet

Add a note to the TSUrlHostGet documentation indicating that it should
only be called after TS_HTTP_POST_REMAP_HOOK. For earlier hooks like
TS_HTTP_READ_REQUEST_HDR_HOOK, TSHttpHdrHostGet should be used instead.

Fixes apache#5742

* docs: fix unknown interpreted text role data

Replace :data: with double backticks for hook names, consistent
with the rest of the documentation.

Fixes apache#5742

* docs: trigger CI for TSUrlHostGet call condition note

* docs: document TSHttpHdrUrlGet hook availability, fix redirect_1 to use TSHttpHdrHostGet

- TSHttpHdrUrlGet: add note that URL components may not be available at
  early hooks, recommend TSHttpHdrHostGet for reliable host retrieval
- TSUrlHostGet: add call condition note (TS_HTTP_POST_REMAP_HOOK onwards)
  and cross-reference to TSHttpHdrHostGet
- TSHttpHdrHostGet: add cross-references to TSHttpHdrUrlGet and TSUrlHostGet
- redirect_1: replace TSHttpHdrUrlGet+TSUrlHostGet with TSHttpHdrHostGet
  which works correctly at TS_HTTP_READ_REQUEST_HDR_HOOK

* fix(docs): replace :c:macro: with double backticks for TS_HTTP_READ_REQUEST_HDR_HOOK

* fix(docs): replace :c:macro: with double backticks for TS_HTTP_READ_REQUEST_HDR_HOOK

* fix(docs): replace :c:macro: with double backticks for TS_HTTP_READ_REQUEST_HDR_HOOK

* fix: restore TSHttpHdrHostGet docs content and add cross-references

- Restored accidentally emptied TSHttpHdrHostGet.en.rst
- Added call condition note explaining TSHttpHdrHostGet vs TSUrlHostGet
- Added See Also cross-references to related APIs

Fixes docs build warning reported by JosiahWI

* fix: add trailing newline to redirect_1.cc

* fix: restore upstream license header formatting

* fix: restore upstream license header formatting

* fix: restore upstream license header formatting

* fix: restore upstream license header in redirect_1.cc

* fix: restore license header and fix broken string literal

* fix: restore blank line after title underline

* fix: add blank line between title and Synopsis

* fix: apply code changes on top of upstream cleanly

* fix: restore redirect_1.cc with correct API changes

* fix: restore redirect_1.cc with correct TSHttpHdrHostGet usage

* fix: apply TSHttpHdrHostGet changes cleanly on upstream

* fix: restore blank line between title and Synopsis

---------

Co-authored-by: Mustafa Senoglu <mustafa@senoglu.local>
(cherry picked from commit 16c434c)
…pache#13338)

* jax_fingerprint: Reduce allocations and gate methods at build time

Trim per-connection memory work in the hybrid (global + remap) setup
by collapsing the per-connection table of fingerprint contexts to an
inline structure and by passing fingerprints into the context without
an intermediate copy. Lookup behavior is unchanged.

Add ENABLE_JAX_METHODS as the configure-time switch for which
fingerprint methods are compiled in. CMake derives the per-method
preprocessor defines, the dispatcher table in plugin.cc, and the slot
count of the inline context table from the same list. An empty list
or an unknown method directory fails at configure time.

Include a developer README covering the per-method file layout, the
build-time switches, and the naming rules that the CMake glob relies
on.

* Address copilot comments

(cherry picked from commit a9e26aa)
…3233)

PR apache#11733 rewrote the CACHE_VALUE_HITS_SIZE cast so static_cast<float>
wraps the whole quotient, making (hits + 1) / (size + overhead) integer
division. It truncates to 0 for normal object sizes, zeroing the value
metric and collapsing CLFUS to FIFO: no promote-on-hit, no clock second
chance, and no value-based ghost re-admission.

Bind the cast to the numerator to restore floating-point division, and
add the ram_cache_clfus_value regression test as a guard (it fails on
the pre-fix macro and passes after).

(cherry picked from commit d1d02c3)
…3383)

* Improve docs for `TSHttpTxnClientPacketMarkSet`

* Add AuTest for `TSHttpTxnClientPacketMarkSet`

* Make changes requested by Brian Neradt

  Allow PACKET_MARK in sock_option_flag_in
  Mention `CAP_NET_RAW` in docstring

(cherry picked from commit 05c958a)
* Add util file for packet mark test plugin

This introduces common utilities to make it easy to add a
server-side packet mark test.

* Generalize packet mark AuTest name

* Ensure header value is null-terminated

(cherry picked from commit 4efc344)
…pache#13370)

With --fetch-query configured, the front-end/first-pass gate set
handleFetch=true whenever the query key was *configured*, not when the
request carried it. So every request whose path matched no
fetch-path-pattern was admitted anyway, ran the pattern replace, failed,
and logged ERROR "failed to process the pattern" -- while scheduling no
prefetch at all (BgFetch runs only on the success path).

Admit only when the request's query actually contains the key, matched
as a "<key>=" parameter rather than a substring (which could hit another
parameter's name or value). The same parameter test is now used by the
hasValidQuery branch selector and the query-branch loop as well.

(cherry picked from commit 03652e4)
…3385)

* Improve docs for `TSHttpTxnServerPacketMarkSet`

* Add AuTest for `TSHttpTxnServerPacketMarkSet`

(cherry picked from commit b1465b4)
Syslog-only diagnostics take the same mutex used to serialize file
output, adding avoidable contention when many threads report a shared
failure.

This limits the diagnostics mutex to FILE-backed destinations and
removes the obsolete FreeBSD exception because syslog provides its own
thread safety.

Fixes: apache#7374
(cherry picked from commit 5fc8ad3)
…#13399)

The Via decoder ring page moved from /tools/via to /via.html on the
project website, leaving the documented URL returning 404. Update the
references in the FAQ and records documentation to the new location.

(cherry picked from commit 4b55a4d)
)

RemapPlugins.h includes RemapProcessor.h, and RemapProcessor.h includes
RemapPlugins.h back, forming an include cycle. RemapPlugins.h does not use
RemapProcessor: the class derives from Continuation and its members are
HttpTransact::State, URL and HTTPHdr, none of which come from RemapProcessor.h.

Everything RemapPlugins.h needs already arrives through its other includes
(EventSystem.h, HttpTransact.h, RemapPluginInfo.h), which are also the only
things RemapProcessor.h contributed to the include closure. Removing the
include breaks the cycle with no call-site changes.

(cherry picked from commit 77b6efc)
moonchen and others added 3 commits July 28, 2026 20:25
No code has ever assigned hookOpRequested this value: the introducing
commit (TS-3006, 2014) only wrote it to an example plugin's own struct,
and the public TSSslVConnOp API that could have set it was removed in
2016 (TS-4658). A hook rejects a handshake via
TSVConnReenableEx(TS_EVENT_ERROR) instead, so drop the enumerator and
its unreachable arm in sslServerHandShakeEvent().

(cherry picked from commit c64d786)
* Document HTTP methods for apache#13420 review

* Make changes requested by Brian Neradt

  Put brief sentence on opening line
  Use in/out/in,out parameter markers
  Clarify that `@` headers are also included in length

(cherry picked from commit e241265)
* Add unit tests for `Action` logic

Authored with Claude Sonnet and Claude Opus.

(cherry picked from commit 04ee11a)
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.