Skip to content
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

fix(core): prefer use of time.monotonic #742

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Conversation

StephenSorriaux
Copy link
Member

Fixes #722

Why is this needed?

time.time() is subject to changes in system local time and can trigger unexpected behavior. Prefer the use of time.monotonic instead of time.time since we are not making use of the actual time, only an amount of time elapsed.

Proposed Changes

  • replace use of time.time() with time.monotonic()

Does this PR introduce any breaking change?

No

@StephenSorriaux StephenSorriaux marked this pull request as draft February 6, 2024 03:07
Copy link
Contributor

@ceache ceache left a comment

Choose a reason for hiding this comment

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

LGTM.

This is a good change, thanks @StephenSorriaux !

@StephenSorriaux StephenSorriaux marked this pull request as ready for review February 6, 2024 16:12
`time.time()` is subject to change sin system local time and can trigger unexpected behaviour. Prefer the use of `time.monotonic` instead of `time.time` since we are not making use of the actual time, only an amount of time elapsed.

Fixes #722
@StephenSorriaux StephenSorriaux merged commit b00d88f into master Feb 7, 2024
28 checks passed
@StephenSorriaux StephenSorriaux deleted the fix/use-of-time branch February 7, 2024 21:36
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.

Unhandled exception in connection loop when administrator sets system time in past
3 participants