init: using 'and' operators can cause hangs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Triaged
|
High
|
Unassigned | ||
mountall (Ubuntu) |
Fix Released
|
High
|
Steve Langasek | ||
Karmic |
Fix Released
|
High
|
Steve Langasek | ||
Lucid |
Fix Released
|
High
|
Steve Langasek | ||
nfs-utils (Ubuntu) |
Fix Released
|
High
|
Steve Langasek | ||
Karmic |
Fix Released
|
High
|
Steve Langasek | ||
Lucid |
Fix Released
|
High
|
Steve Langasek | ||
upstart (Ubuntu) |
Invalid
|
Medium
|
Unassigned | ||
Karmic |
Won't Fix
|
Undecided
|
Unassigned | ||
Lucid |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Event operators are reset each time they become TRUE, with the blocking state being transferred to the actual instance that is started. This means that combining the two operators leads to undesirable behaviour.
For example, in /etc/init/
start on gandalf and (bilbo or thorin)
When gandalf arrives, he'll block waiting for bilbo or thorin. If bilbo then arrives, the operator tree is complete and the quest can start.
If thorin then arrives, he'll block waiting for gandalf. Unfortunately gandalf has already gone, so he has little choice but to sit down and start singing about gold.
A short-term fix is not to combine event operators this way, and instead separate them out into separate jobs. For example if we had an /etc/init/
start on bilbo or thorin
Then /etc/init/
start on gandalf and started quest/member
In this case when gandalf arrives, he'd still block on a quest member. Bilbo then arrives, "starting" the quest/member job and thus also starting the quest.
If thorn then arrives, the quest/member job has already been started so he doesn't block waiting for it to start.
The longer term fix is included in the move to "while", which means that we'd remember that we had gandalf so when thorin arrived he'd know the quest was already started - and he could either start a new quest or catch up with the existing one.
Changed in mountall (Ubuntu Karmic): | |
assignee: | nobody → Steve Langasek (vorlon) |
status: | Triaged → Fix Released |
Changed in nfs-utils (Ubuntu Karmic): | |
assignee: | nobody → Steve Langasek (vorlon) |
importance: | Undecided → High |
milestone: | none → ubuntu-9.10 |
status: | New → In Progress |
summary: |
- using 'and' and 'or' operators together in upstart job deps causes hangs + init: using 'and' and 'or' operators together causes hangs |
Changed in upstart: | |
status: | New → Triaged |
importance: | Undecided → High |
summary: |
- init: using 'and' and 'or' operators together causes hangs + init: using 'and' operators can cause hangs |
This code turned out to be the culprit:
} else if (mount_parent && (mount_parent->tag == TAG_LOCAL) parent- >mountpoint, "/")) {
&& strcmp (mount_
mnt->tag = TAG_LOCAL;
num_local++;
nih_debug ("%s is local (inherited)", mnt->mountpoint);
}
This code was added so that virtual filesystems didn't get marked as virtual if they were waiting on other local filesystems, but instead had the effect that all remote filesystems mounted anywhere except / were also treated as local.
Checking now that this is the only code that needs fixed.