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

App restart via API does not respect service dependency in depends_on #2181

Open
pipex opened this issue Jul 4, 2023 · 1 comment
Open

Comments

@pipex
Copy link
Contributor

pipex commented Jul 4, 2023

The composition service ordering is used when updating between services, but not during service updates. This is due to the supervisor obtaining the services information from the current state, while depends_on only exists in the composition.

return await lock(appId, { force }, async () => {
const currentState = await deviceState.getCurrentState();
if (currentState.local.apps?.[appId] == null) {
throw new InternalInconsistencyError(
`Application with ID ${appId} is not in the current state`,
);
}
const app = currentState.local.apps[appId];
const services = app.services;
app.services = [];
return deviceState
.applyIntermediateTarget(currentState, {
skipLock: true,
})
.then(() => {
app.services = services;
return deviceState.applyIntermediateTarget(currentState, {
skipLock: true,
keepVolumes: false,
});
})
.finally(() => {
deviceState.triggerApplyTarget();
});
});

Probably the right approach is to merge the target state with the runtime state to obtain the correct target.

@jellyfish-bot
Copy link

[pipex] This has attached https://jel.ly.fish/4f492090-44a9-44c8-bea8-0028f16f6599

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

No branches or pull requests

2 participants