-
Notifications
You must be signed in to change notification settings - Fork 55
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
PoC: auto-restart services failed within okaydelay only when startup enabled #513
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.
A couple of things about this PoC:
- This modifies the "autorestart" API command, but I don't think that's what Harry was suggesting. Rather, the autoRestart=true mode should be enabled if
startup: enabled
was specified in the Pebble plan, regardless of which start API command is used. - You shouldn't need to modify the low-level Task struct. You can Set arbitrary data on the task already. But even that I don't think we need -- the servstate manager already has a copy of the plan, so only the service name is needed in the task. Then in
doStart
you'd check ifconfig.Startup == plan.StartupEnabled
.
8c89e62
to
8710543
Compare
Force-pushed a new commit according to Ben's comment. |
This isn't what I had in mind. I was expecting we would transition directly to running (instead of starting+okDelay timer) and have that be the flow. This change ignores all the other on-failure/on-success actions if it finishes in 1s. |
|
Yeah, what @hpidcock said sounds better (and simpler). Probably also easier to reason about and document, as we can document it in terms of states / state transitions too. |
…kaydelay-with-startup-enabled-2
Closing this PoC PR after an internal discussion with Ben and Haryr, I will create a new one to according to the discussion. |
This is a PoC where we auto-restart failed services only when startup is enabled.
Manual test:
Layer:
pebble run
/pebble replan
/pebble start test
:Behaviour for services not configured with
startup: enabled
isn't affected.