You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bryancall (via GitHub)" <gi...@apache.org> on 2026/02/19 22:47:03 UTC

[PR] Fix: msdms log fields emit dash instead of -1 for unset milestones [trafficserver]

bryancall opened a new pull request, #12900:
URL: https://github.com/apache/trafficserver/pull/12900

   * **New `unmarshal_milestone_diff()` function** -- outputs a single `-` character when the marshalled milestone difference is negative (i.e., one or both milestones were unset), instead of the literal string `-1`. This makes log parsing cleaner: parsers can distinguish "0 ms" (a valid sub-millisecond timing) from "not applicable" without checking for a magic integer sentinel.
   
   * **MSDMS container uses new unmarshal function** -- `LogField.cc` now assigns `unmarshal_milestone_diff` instead of the generic `unmarshal_int_to_str` for MSDMS fields.
   
   **Example output change:**
   ```
   # Before: unset milestone shows -1
   c_tls=-1 dns=-1 o_tcp=-1
   
   # After: unset milestone shows -
   c_tls=- dns=- o_tcp=-
   ```
   
   **Testing:** Validated with the milestone logging autest from #12899 (updated to accept `-` as a valid sentinel). Manual verification with `traffic_logcat` on binary logs.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: msdms log fields emit dash instead of -1 for unset milestones [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on PR #12900:
URL: https://github.com/apache/trafficserver/pull/12900#issuecomment-3931965377

   [approve ci rocky]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: msdms log fields emit dash instead of -1 for unset milestones [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on PR #12900:
URL: https://github.com/apache/trafficserver/pull/12900#issuecomment-3930735775

   [approve ci]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: msdms log fields emit dash instead of -1 for unset milestones [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall closed pull request #12900: Fix: msdms log fields emit dash instead of -1 for unset milestones
URL: https://github.com/apache/trafficserver/pull/12900


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: msdms log fields emit dash instead of -1 for unset milestones [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on PR #12900:
URL: https://github.com/apache/trafficserver/pull/12900#issuecomment-3931000480

   [approve ci autest 1]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: msdms log fields emit dash instead of -1 for unset milestones [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on PR #12900:
URL: https://github.com/apache/trafficserver/pull/12900#issuecomment-3930711293

   [approve ci osx]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: msdms log fields emit dash instead of -1 for unset milestones [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall merged PR #12900:
URL: https://github.com/apache/trafficserver/pull/12900


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: msdms log fields emit dash instead of -1 for unset milestones [trafficserver]

Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on PR #12900:
URL: https://github.com/apache/trafficserver/pull/12900#issuecomment-3931000823

   [approve ci rocky]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: msdms log fields emit dash instead of -1 for unset milestones [trafficserver]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12900:
URL: https://github.com/apache/trafficserver/pull/12900#discussion_r2830570726


##########
src/proxy/logging/LogAccess.cc:
##########
@@ -626,6 +626,41 @@ LogAccess::unmarshal_int_to_str(char **buf, char *dest, int len)
   return -1;
 }
 
+/*-------------------------------------------------------------------------
+  LogAccess::unmarshal_milestone_diff
+
+  Unmarshal a milestone difference value.  Returns "-" when the
+  marshalled value is negative (milestone was unset), otherwise
+  the decimal string representation.
+  -------------------------------------------------------------------------*/
+
+int
+LogAccess::unmarshal_milestone_diff(char **buf, char *dest, int len)
+{
+  ink_assert(buf != nullptr);
+  ink_assert(*buf != nullptr);
+  ink_assert(dest != nullptr);
+
+  int64_t val = unmarshal_int(buf);
+  if (val < 0) {
+    if (len >= 1) {

Review Comment:
   `unmarshal_milestone_diff()` treats any negative value as an unset milestone and emits "-". However, `TransactionMilestones::difference_msec()` can also return negative values when both milestones are set but the start/end order is reversed (end-start < 0), so this would hide legitimate negative durations. Consider mapping only the "missing" sentinel (currently -1 from `difference_msec`'s default) to "-", and leaving other negative values as numeric output so mis-ordered milestones remain debuggable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org