Skip to content

Conversation

@kanru
Copy link
Contributor

@kanru kanru commented Jan 9, 2025

Time drift happens and time going backwards is common on NTP enabled servers. When time drift happens it's not worth it to kill the node session.

Change the timestamp payload to use duration against NodeSession specific Instant epoch initialized at creation time. This ensures the timestamp increases monotonically. It can only go backwards when the payload is malformed.

Note - this makes the timestamp in the payload an offset from UNIX_EPOCH. I think it is fine and nobody should be reading the timestamp for anything useful.

@codecov
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 42.85714% with 8 lines in your changes missing coverage. Please review.

Project coverage is 82.08%. Comparing base (b0cd1a0) to head (ad44a78).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
ractor_cluster/src/node/node_session/mod.rs 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #320      +/-   ##
==========================================
- Coverage   82.08%   82.08%   -0.01%     
==========================================
  Files          61       61              
  Lines       12198    12206       +8     
==========================================
+ Hits        10013    10019       +6     
- Misses       2185     2187       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Time drift happens and time going backwards is common on NTP enabled
servers. When time drift happens it's not worth it to kill the node
session.

Change the timestamp payload to use duration against NodeSession
specific Instant epoch initialized at creation time. This ensures
the timestamp increases monotonically. It can only go backwards
when the payload is malformed.

Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
@kanru kanru force-pushed the refactor-improve-ping-robust branch from 4319ce2 to ad44a78 Compare January 9, 2025 12:30
Copy link
Owner

@slawlor slawlor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution!

@slawlor slawlor merged commit d385bc9 into slawlor:main Jan 9, 2025
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

None yet

2 participants