Skip to content

introduce restart for depends_on#305

Merged
ndeloof merged 1 commit intocompose-spec:masterfrom
ndeloof:depends_on_restart
Feb 16, 2023
Merged

introduce restart for depends_on#305
ndeloof merged 1 commit intocompose-spec:masterfrom
ndeloof:depends_on_restart

Conversation

@ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Feb 14, 2023

What this PR does / why we need it:
introduce additional restart attribute on depends_on.
This let user explicitly opt-in for service to be restarted after a dependency has been restarted.

Copy link
Member

@milas milas left a comment

Choose a reason for hiding this comment

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

LGTM, I nitpicked the wording but no concerns on the actual spec/schema

spec.md Outdated
The long form syntax enables the configuration of additional fields that can't be
expressed in the short form.

- `restart`: when `true` a Compose implementation MUST restart service after dependent service has been restarted.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- `restart`: when `true` a Compose implementation MUST restart service after dependent service has been restarted.
- `restart`: when `true` a Compose implementation MUST restart this service after updates to the dependency service.

(English is horrible here, there's no non-confusing way to talk about dependencies. 😡) Looking at this section, though, we refer to the "parent" service as "dependency service" and the "child" service as dependent, so trying to be consistent

Also, I'm not crazy about my change from "has been restarted" to "after updates" - we probably need another sentence of clarification here to be explicit that the restart will only happen as part of a Compose operation, e.g. if parent dies and gets auto-restarted by Docker Engine, nobody is going to restart child in that case. That is, this is a "deployment" (up) level thing, there's no background daemon monitoring

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could make it more explicit as
" a Compose implementation MUST restart this service after it updated the dependency service. " so that users don't expect some magic to happen :)

Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof merged commit 4ccbdd7 into compose-spec:master Feb 16, 2023
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.

3 participants