Fix: set UA_BEGIN_WRITE milestone unconditionally#12898
Merged
bryancall merged 1 commit intoapache:masterfrom Feb 21, 2026
Merged
Fix: set UA_BEGIN_WRITE milestone unconditionally#12898bryancall merged 1 commit intoapache:masterfrom
bryancall merged 1 commit intoapache:masterfrom
Conversation
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
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).
Contributor
There was a problem hiding this comment.
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_WRITEwhent_state.next_actionisSERVER_READ. - Mark
TS_MILESTONE_UA_BEGIN_WRITEwhent_state.next_actionisSERVE_FROM_CACHE.
zwoop
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mark
UA_BEGIN_WRITEinSERVER_READandSERVE_FROM_CACHE-- this milestone was only set inside theAPI_SEND_RESPONSE_HDRhook path, which requires a plugin to hookTS_HTTP_SEND_RESPONSE_HDR_HOOK. Without that hook,UA_BEGIN_WRITEstayed at zero, causing allmsdmslog 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.