You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use System.nanoTime() for cron check-in duration measurement (#5611)
* fix: use System.nanoTime() for cron check-in duration measurement
System.currentTimeMillis() is a wall-clock value and is subject to
NTP adjustments and DST transitions. For long-running cron jobs this
can produce incorrect or even negative durations in the check-in payload.
Switch the start/end capture in CheckInUtils.withCheckIn() and the three
SentryCheckInAdvice implementations (sentry-spring, sentry-spring-jakarta,
sentry-spring-7) to System.nanoTime(), which is guaranteed monotonic.
Use DateUtils.nanosToSeconds() (already present) to convert the delta.
Fixes#5579
* changelog
---------
Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
5
5
### Fixes
6
6
7
+
- Use `System.nanoTime()` for cron check-in duration measurement to avoid incorrect durations from wall-clock adjustments ([#5611](https://github.com/getsentry/sentry-java/pull/5611))
7
8
- Fix crash when `getHistoricalProcessStartReasons` is called from an isolated or wrong-userId process ([#5597](https://github.com/getsentry/sentry-java/pull/5597))
8
9
- Release `MediaMuxer` when a replay segment has no encodable frames to avoid a resource leak ([#5583](https://github.com/getsentry/sentry-java/pull/5583))
0 commit comments