You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "songzhendong (via GitHub)" <gi...@apache.org> on 2026/10/15 22:43:51 UTC

[PR] Fix eBPF access-log timestamps truncating nanosecond offsets to whole seconds [skywalking]

songzhendong opened a new pull request, #14145:
URL: https://github.com/apache/skywalking/pull/14145

   ## Summary
   
   `NodeInfo.parseTimestamp` truncated the nanosecond-since-boot offset (`EBPFOffsetTimestamp`) to whole seconds with `TimeUnit.NANOSECONDS.toSeconds`, and also dropped `bootTime.nanos`, before converting to epoch millis.
   
   Effects:
   - Mesh HTTP latency (`end - start`) for short requests was quantized to 0 or 1000ms, depending on whether the request crossed a whole-second boundary.
   - Minute time buckets could land in the wrong minute near minute boundaries.
   
   ## Fix
   
   Convert with the same Instant-plus-nanos style used by Envoy ALS wall-time conversion:
   
   ```java
   Instant.ofEpochSecond(bootSeconds, bootNanos).plusNanos(offset).toEpochMilli()
   ```
   
   `parseMinuteTimeBucket` now reuses `parseTimestamp` so wall time and minute buckets stay consistent.
   
   ## Tests
   
   - Unit tests for sub-second offset, boot nanos, second carry, legacy whole-second parity, sub-ms floor, and minute-boundary divergence from the old truncation path.
   - `generateHTTPServiceMeshMetrics` regression: non-zero boot nanos + 123ms request that crosses a whole-second boundary; asserts start/end/latency.
   
   ## Test plan
   
   - [x] `AccessLogServiceHandlerNodeInfoTest`
   - [x] `AccessLogServiceHandlerMeshMetricsTest`
   - [x] Internal fork CI green on `songzhendong/skywalking-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: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] Fix eBPF access-log timestamps truncating nanosecond offsets to whole seconds [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #14145:
URL: https://github.com/apache/skywalking/pull/14145#issuecomment-6205737255

   Please resolve conflicts.


-- 
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: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] Fix eBPF access-log timestamps truncating nanosecond offsets to whole seconds [skywalking]

Posted by "songzhendong (via GitHub)" <gi...@apache.org>.
songzhendong commented on PR #14145:
URL: https://github.com/apache/skywalking/pull/14145#issuecomment-6209946070

   After investigation, the conclusion is as follows.
   
   The Windows unit-test failure is `HttpAlarmCallbackTest.acceptedStatusesAreNotLoggedAsFailure` in `server-core`. Both Maven attempts failed in about 44ms and 43ms with:
   
   ```
   java.io.IOException: HTTP/1.1 header parser received no bytes
   Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host
   ```
   
   This test and its local `HttpServer` handler were added in #13968, not in this PR. The handler writes the response and closes the exchange without reading the request body. On Windows that can reset the connection before the JDK `HttpClient` reads any response bytes. It shows up most often on 204, which has no response body, so the response headers and the close are very close together. Whether the status line or the reset is seen first depends on timing, which is why the same test passed on the master Windows run at `8c9901c` and failed twice here.
   
   This PR does not change `HttpAlarmCallback` or this test, and the failure does not appear to come from the eBPF timestamp fix.
   
   The same Windows unit test passed on my fork CI, along with the rest of that run: https://github.com/songzhendong/skywalking/actions/runs/38842785376
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] Fix eBPF access-log timestamps truncating nanosecond offsets to whole seconds [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #14145:
URL: https://github.com/apache/skywalking/pull/14145#issuecomment-6206946140

   @songzhendong The UT(windows) keeps failure. You may need to recheck codes.


-- 
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: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] Fix eBPF access-log timestamps truncating nanosecond offsets to whole seconds [skywalking]

Posted by "songzhendong (via GitHub)" <gi...@apache.org>.
songzhendong commented on PR #14145:
URL: https://github.com/apache/skywalking/pull/14145#issuecomment-6206544767

   Thanks for the review


-- 
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: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] Fix eBPF access-log timestamps truncating nanosecond offsets to whole seconds [skywalking]

Posted by "songzhendong (via GitHub)" <gi...@apache.org>.
songzhendong commented on PR #14145:
URL: https://github.com/apache/skywalking/pull/14145#issuecomment-6207599195

   The Windows unit-test failure is `HttpAlarmCallbackTest.acceptedStatusesAreNotLoggedAsFailure` in `server-core`. The two Maven attempts in that job failed in about 44ms and 43ms with:
   
   ```
   java.io.IOException: HTTP/1.1 header parser received no bytes
   Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host
   ```
   
   The failure appears to be a connection-reset issue in the existing local HTTP test. Closing the exchange without consuming the request body is a possible cause, particularly for the 204 response, but this has not yet been confirmed. The log does not show which status was in progress when the connection closed.
   
   This test and `HttpAlarmCallback` do not appear to be changed by this PR. The diff only touches the eBPF access-log timestamp conversion, and that code does not look like it is on this test's path. The `server-core` tests run in a Surefire fork for that module. The same Windows unit-test job passed on the master scheduled CI at `8c9901c`. The eBPF end-to-end jobs in this run passed, including the `Windows` end-to-end job. From what I can see, this failure looks unrelated to the eBPF timestamp fix, though I cannot fully rule out an environmental flake.
   
   I already verified this change on `songzhendong/skywalking-ci` (https://github.com/songzhendong/skywalking-ci/pull/5) before opening this upstream PR, and that run was green. I deleted that repository today so I can keep OAP CI in one place, `songzhendong/skywalking`, which is easier to manage. After I restored it, the branches and pull requests came back, but the Actions run history did not (`workflow_runs` is empty), so I cannot link the previous CI result.
   
   I am re-running the internal fork CI now and will wait for that result to confirm.
   
   Note: this code was verified by Cursor, Copilot, and GPT 6.1 Sol Ultra.
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] Fix eBPF access-log timestamps truncating nanosecond offsets to whole seconds [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #14145:
URL: https://github.com/apache/skywalking/pull/14145


-- 
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: notifications-unsubscribe@skywalking.apache.org

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