Bug #7387
closedSMF is fast and loose with require_any/service dependencies
0%
Description
Service instances are started by graph_start_if_satisfied() in startd/graph.c. This function calls instance_satisfied with 'satbility' set to B_FALSE (the 'satbility' flag is used to enable/disable checking for unsatisfiable dependencies) which in turn is passed to the dependency functions.
https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/svc/startd/graph.c#L1691
Unfortunately due to a bug in require_any_satisfied it always returns '1' when 'satbility' is set to B_FALSE. Even more unfortunate is that dependencies on services are mapped internally to a require_any dependency group containing all instances of said service. In short, you cannot rely on require_any or service dependencies to be satisfied before your service starts.
https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/svc/startd/graph.c#L1300
Related issues
Updated by Rich Lowe about 7 years ago
This makes sense, but I'm not sure which piece of what you describe is the wrong one.
The behaviour of the 'satbility' flag seems like it may make sense, from a certain point of view. But if it does, the mapping to a require_any with it passed B_FALSE does not.
Also, allow me to state for the record just how upset I am that the flag is really called "satbility" and is not a typo.
Updated by Andrew Stormont about 7 years ago
Let me clarify what the 'satbility' flag is supposed to do. The dependency functions return 1 (satisfied), 0 (unsatisfied) or -1 (unsatisfiable). Because it takes a bit more work to determine if a dependency is unsatisfiable and that information is not always needed, the satbilility flag can be used to turn it off. In that case functions should only return 1 or 0.
Updated by Andrew Stormont about 7 years ago
Updated by Andrew Stormont about 7 years ago
- Related to Bug #7267: SMF is fast and loose with optional dependencies added
Updated by Andrew Stormont over 6 years ago
- Status changed from New to Resolved
This fixed was rolled into #7267