-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doubts about discarding monotonic time #697
Comments
This reverts commit edb6929. In that commit, active time was changed from time.Time to Unix time in order to avoid allocations. Unfortunately, that has the side effect of discarding the monotonic component of time.Time, and therefore makes our code vulnerable to stepping of the system clock. Fixes pion#697
in practice i don't think it matters. on any well behaved system the aberrations in wall clock time should be smaller than the tolerance for timeout/keepalive scheduling. because it's part of the public api we can't really do anything more clever. go ahead and revert it if you like. none of this had a measurable impact on my target metric. |
What happens if the system clock is stepped? Some systems have no battery-backed clock. On such systems, the system clock is stepped after NTP has had time to converge, typically a couple of minutes after boot. If I understand your patch correctly, it will cause Pion to break after the clock is stepped.
Did you test while stepping the clock?
@Sean-Der could you please consider PRs #698 and #699? They unbreak Pion on systems with no battery-backed clock (such as Raspberry Pis and other SBCs). |
sorry i thought you had commit or i would have done it myself. like i said, this didn't fix the issue i was trying to solve so i'm not super attached to it. |
This reverts commit edb6929. In that commit, active time was changed from time.Time to Unix time in order to avoid allocations. Unfortunately, that has the side effect of discarding the monotonic component of time.Time, and therefore makes our code vulnerable to stepping of the system clock. Fixes #697
Thanks! |
Hi,
I'm looking at @paulwe optimisations to pion/ice right now, thanks a lot for the work, Paul.
I have a doubt about commit e1c2d85, where the
lastSent
andlastReceived
fields ofcandidateBase
have been changed fromtime.Time
to Unix time. In doing so, they no longer contain monotonic time, and therefore become susceptible to stepping clocks.Paul, can you confirm that this change will not cause trouble if the system clock is stepped? If not, then I suggest that either the commit should be reverted, or we should use a technique similar to what I do in https://github.com/jech/storrent/blob/master/mono/mono.go, where I had exactly the same problem (albeit with just second granularity).
The text was updated successfully, but these errors were encountered: