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

Alloy Service startup should be deterministic & ordered #2157

Open
dehaansa opened this issue Nov 25, 2024 · 0 comments
Open

Alloy Service startup should be deterministic & ordered #2157

dehaansa opened this issue Nov 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@dehaansa
Copy link
Contributor

Request

The Services (HTTP service, UI service, remote cfg service, etc) have dependencies, laid out in their DependsOn parameter. However, the scheduler does not enforce any starting order and ensure other services are fully available before starting ones that depend upon them.

This caused a panic #2144 when the HTTP service tried to install the UI service's endpoints that depend on the remote config service, but the remote config service had not yet executed its Run() function and stored a variable that the UI service depended upon. This was a race condition that would not have been present if the services were started in order, with that order informed by the DependsOn parameter.

This will require changes to the Scheduler to start components in order, and the ServiceNode (and likely other Node) implementations need a Wait Group or chan or mutex provided to be able to inform the scheduler that they are ready for their dependent components to start.

Use case

This will help prevent future issues, and enforce the DependsOn contract in a way that allows developers to trust the availability of other services.

@dehaansa dehaansa added the enhancement New feature or request label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant