www.nico.schottelius.org/software/cinit/browse_source/cinit-0.3pre15/doc/braindumps/circular-dependencies.text
Nico Schottelius 440caeb555 add cinit-0.3pre15
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-09-23 08:01:33 +02:00

35 lines
1.3 KiB
Text

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?