bryancall opened a new pull request, #12860: URL: https://github.com/apache/trafficserver/pull/12860
## Description Add `TS_MILESTONE_SERVER_TLS_HANDSHAKE_START` and `TS_MILESTONE_SERVER_TLS_HANDSHAKE_END` milestones to capture origin-side TLS handshake timing. Previously, only client-side TLS timing was available via `TS_MILESTONE_TLS_HANDSHAKE_START/END`, making it impossible to measure origin TLS handshake overhead in the slow log or via the milestone API. ## Changes ### New server-side TLS milestones (commit 1) - Add `TS_MILESTONE_SERVER_TLS_HANDSHAKE_START/END` enum values in `apidefs.h.in` (ABI compatible — appended before `TS_MILESTONE_LAST_ENTRY`) - Capture server TLS timing in `HttpSM::state_http_server_open()` for both the direct (`VC_EVENT_WRITE_COMPLETE`) and multiplexed (`CONNECT_EVENT_TXN`) connection paths - **Fix**: `SSLNetVConnection::sslClientHandShakeEvent()` was recording TLS handshake start time for outbound connections but never calling `_record_tls_handshake_end_time()` — outbound TLS end time was always 0 - Rename slow log field `tls_handshake` → `ua_tls_handshake` for clarity, add new `server_tls_handshake` field in logical position after `server_connect_end` - Update `LogField.cc` milestone-to-string mappings for custom log fields - Add Lua plugin milestone constants (`TS_LUA_MILESTONE_SERVER_TLS_HANDSHAKE_START/END`) - Update `TSHttpTxnMilestoneGet` API documentation - Update `slow_log_report.pl` to parse new field names ### Fix `difference_msec()` milestone check (commit 2) - `difference_msec()` only checked if `ms_end == 0` (unset) before returning the missing sentinel. If `ms_start` was unset but `ms_end` was set, the subtraction would produce a garbage value. Now checks both `ms_start` and `ms_end` for 0. ## Behavior Notes - When no server TLS handshake occurs (non-TLS origin, connection reuse), the milestones remain 0 and the slow log reports `-0.001` (the "missing" sentinel), consistent with other unset milestones. - The `tls_handshake` → `ua_tls_handshake` rename is a slow log text change only — it does not affect ABI. - Existing `TS_MILESTONE_TLS_HANDSHAKE_START/END` enum values and behavior are unchanged. ## Testing - [x] Build passes (including ASAN build) - [x] Manual testing with client-side and server-side TLS verified both milestone pairs populate correctly - [x] `slow_log_report.pl` correctly parses and reports both `ua_tls_handshake` and `server_tls_handshake` - [x] Verified milestones remain 0 for non-TLS and connection-reuse scenarios -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
