www.nico.schottelius.org/software/cinit/browse_source/cinit-0.3pre2/doc/braindumps/circular-dependencies.text

36 lines
1.3 KiB
Text
Raw Normal View History

What todo with circular dependencies?
a needs b
b needs a
- try to start them?
status a: is_starting
status b: not_set
a wants b, so a service starter for b starts
status a: is_starting, waiting for b
status b: is_starting
service starter for b sees that a is needed
service starter for b sees that a is already being started
service starter for b begins to execute b
status a: is_starting, waiting for b
status b: is_starting, executing "on"
service starter b finishes
status a: is_starting, waiting for b
status b: FAILED | RESPAWN | ONCE
service a continues
b successful: execute on
b failed: register / print that we do not start, because
b failed
-> this would only catch possible deadlocks, if the dependency
tree / status check is done dynamically
-> in case of pre-building the dep-tree this situation must
be concerned:
- start both a and b?
- or stop due to circular dependency?
- Abort on detection of a circular dependency
* possible without pre-calculating?
- perhaps only with direct communication possible?
* pre calculate
- do not start that services?