Skip to content

Fix: set UA_BEGIN_WRITE milestone unconditionally#12898

Merged
bryancall merged 1 commit intoapache:masterfrom
bryancall:fix-ua-begin-write-unconditional
Feb 21, 2026
Merged

Fix: set UA_BEGIN_WRITE milestone unconditionally#12898
bryancall merged 1 commit intoapache:masterfrom
bryancall:fix-ua-begin-write-unconditional

Conversation

@bryancall
Copy link
Contributor

@bryancall bryancall commented Feb 19, 2026

Mark UA_BEGIN_WRITE in SERVER_READ and SERVE_FROM_CACHE -- this milestone was only set inside the API_SEND_RESPONSE_HDR hook path, which requires a plugin to hook TS_HTTP_SEND_RESPONSE_HDR_HOOK. Without that hook, UA_BEGIN_WRITE stayed at zero, causing all msdms log fields that reference it (c_ttfb, o_proc, o_body, hit_proc, hit_xfer) to report -1.

In production environments with plugins this was masked, but bare ATS installations and autests saw missing values for these fields.

Testing: Existing autests pass. A dedicated milestone logging autest will be added in a follow-up PR.

Mark TS_MILESTONE_UA_BEGIN_WRITE in the SERVER_READ and SERVE_FROM_CACHE
paths of handle_api_return(). Previously this milestone was only set in
the API_SEND_RESPONSE_HDR hook path, which requires a plugin to hook
TS_HTTP_SEND_RESPONSE_HDR_HOOK. Without plugins the milestone stayed
at zero, causing msdms log fields that reference UA_BEGIN_WRITE
(c_ttfb, o_proc, o_body, hit_proc, hit_xfer) to report -1.
@bryancall bryancall added this to the 10.2.0 milestone Feb 19, 2026
@bryancall bryancall self-assigned this Feb 19, 2026
bryancall added a commit to bryancall/trafficserver that referenced this pull request Feb 19, 2026
New end-to-end test that sends a cacheable request twice (miss then hit)
and validates all Phase 1 msdms timing fields in the resulting log:

- All 16 key=value fields present on every line
- Values are integers with no epoch-length garbage
- Cache miss: origin-phase chain sums to c_ttfb within 2ms
- Cache hit: hit_proc and hit_xfer are non-negative

Includes a reusable verify_milestone_fields.py validation script.

Depends on apache#12897 (difference_msec fix) and apache#12898 (UA_BEGIN_WRITE fix).
@bryancall bryancall requested a review from Copilot February 19, 2026 22:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes missing UA_BEGIN_WRITE timestamps in HttpSM for transactions that do not traverse the TS_HTTP_SEND_RESPONSE_HDR_HOOK path (i.e., no plugin hook registered), which caused multiple msdms-derived log fields to report -1.

Changes:

  • Mark TS_MILESTONE_UA_BEGIN_WRITE when t_state.next_action is SERVER_READ.
  • Mark TS_MILESTONE_UA_BEGIN_WRITE when t_state.next_action is SERVE_FROM_CACHE.

@bryancall bryancall merged commit 069d5a3 into apache:master Feb 21, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants