-
Notifications
You must be signed in to change notification settings - Fork 20
add notify timeboost #681
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
base: main
Are you sure you want to change the base?
add notify timeboost #681
Conversation
akonring
left a comment
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.
LGTM 👍
| After=network.target nitro.service | ||
| Requires=network-online.target | ||
| Wants=nitro.service | ||
| Requires=network-online.target nitro.service |
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.
I wonder if the dependency to nitro has to be:
BindsTo=nitro.service
Timeboost should not run when nitro isn't and BindsTo is a stronger dependency mode than Requires.
| Environment=RUST_LOG={{LOG_DIRECTIVES}} | ||
| Restart=always | ||
| RestartSec=5 | ||
| TimeoutStartSec=infinity |
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.
Why is this needed? Startup should be more or less instant. I would not expect systemd to count the time a dependency requires for its own startup to count against the dependent's startup duration.
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.
this is really only needed in the case of no database on the machine and has to rebuild the whole chain data. i dont think this should ever be the case as an operator should ideally never start without a database. So we would notify immediately. Perhaps we should just remove the time
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.
What I had in mind is that systemd would not start Timeboost before Nitro has completed its own startup (regardless of how long that takes), so systemd should not have to wait for Timeboost to start.
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.
sorry i do not quite follow. When we call:
systemctl start timeboost.service
and timeboost.service depends on nitro, if nitro takes an excessive amount of time to sync up, timeboost will fail. that is why i added the timeout. but I guess since we restart as per config, this is fine? or am i not understanding something?
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.
IIUC TimeoutStartSec is only relevant for services that signal startup completion. timeboost.service is of type simple, i.e. systemd considers timeboost started right after it forked it. Furthermore, systemd knows that timeboost depends on nitro, but it would not count nitro's startup time against timeboost's.
| Environment=HOME=/home/ec2-user | ||
| Restart=always | ||
| RestartSec=5 | ||
| TimeoutStartSec=infinity |
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.
Maybe we should add this too:
BindsTo=timeboost.service
Both services depend on each other. If timeboost stops, so should nitro.
Closes #<ISSUE_NUMBER>
This PR:
This PR does not:
Key places to review: