Race condition with services instantiation in modules #6174
Labels
bug
Something isn't working
frozen-due-to-age
Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
What's wrong?
While config blocks are not permitted to be used inside of a module definition, this is not the case for service blocks.
This means, that for example an
http
block can be instantiated and evaluated within a module, but it still refers to the original shared service of the root module. This can lead to inconsistent behavior, depending on the order of evaluation.This also means that a module loader can accidentally impact the functionality of the root controller, or other module loaders.
A potential solution would be to restrict the definition of service blocks to the root configuration only; another solution would be to allow modules to instantiate and use their own instance of a service if they provide a block.
cc @rfratto as the original author of services and @wildum as part of his work on #5968.
Steps to reproduce
Use the configuration like the following, and try to reload the configuration.
Depending on the order of evaluation, the reload might either go through or fail with
Client sent an HTTP request to an HTTPS server.
System information
macOS
Software version
main (2e41841)
Configuration
Logs
Logs show the
node_id=http
evaluation order from differentcontroller_id
sThe text was updated successfully, but these errors were encountered: