-
Notifications
You must be signed in to change notification settings - Fork 108
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
Stop doing thousands of time checks each time we connect to a peer #3106
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but there seems to be an issue with the usage of BTreeMap
Bumping this up to medium, because it's required for #1873 in this sprint. |
c58e02e
to
99fd439
Compare
99fd439
to
64e5d1c
Compare
I went with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Motivation
Zebra checks the current time 4 times per address book peer, every time we connect to a new peer. If the address book has thousands of peers, it can do hundreds of thousands of time system calls every second.
This is unexpected work in sprint 23, but we might need it to make CI more reliable.
Scope
This PR only changes how often Zebra checks the time.
Other changes and cleanups are out of scope.
Solution
Time checks:
Bug fixes:
This seems like a bug in Rust or the OS, we really shouldn't be getting earlier times when we remove some time calls. It might also be a multithreading memory consistency issue.
Review
This PR is a blocker for #1873, so we should review it soon.
Reviewer Checklist
Follow Up Work
This PR makes it more obvious when we're using
std::time::Instant
instead oftokio::time::Instant
. We should fix that in ticket #2258.