Project

General

Profile

Actions

Bug #7387

closed

SMF is fast and loose with require_any/service dependencies

Added by Andrew Stormont about 7 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2016-09-16
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

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

Related to illumos gate - Bug #7267: SMF is fast and loose with optional dependenciesClosed2016-08-03

Actions
Actions #1

Updated by Andrew Stormont about 7 years ago

  • Description updated (diff)
Actions #2

Updated by Andrew Stormont about 7 years ago

  • Description updated (diff)
Actions #3

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.

Actions #4

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.

Actions #5

Updated by Andrew Stormont about 7 years ago

  • Description updated (diff)
Actions #7

Updated by Andrew Stormont about 7 years ago

  • Description updated (diff)
Actions #8

Updated by Andrew Stormont about 7 years ago

  • Related to Bug #7267: SMF is fast and loose with optional dependencies added
Actions #9

Updated by Andrew Stormont over 6 years ago

  • Status changed from New to Resolved

This fixed was rolled into #7267

Actions

Also available in: Atom PDF