New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 677915 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

factory init: Find a stable way to inhibit jobs

Project Member Reported by hungte@chromium.org, Jan 3 2017

Issue description

This is related to recent crash about devices using trunksd.

We've found that if trunksd didn't start in time, Chrome may crash. If we put trunksd into common.d/inhibit_jobs, Chrome will also crash.

The issue to discuss here is the case of having trunksd inhibited.

Background:

Upstart has a rule (that I'm not 100%, but seems so) if a job's (say job_a) rule is 'start on starting other_job', then other_job won't be executed until job_a has entered 'started' state.

trunksd was made as 'start on starting system-services and started dbus'.

So if we try to stop it (the common.d/inhibit_jobs was done by calling "stop -n job" inside the job filter), it seems like system-services may not move on and stuck at 'starting' state.

However, we don't see same issue for all other jobs that also set start on 'starting system-services', for example cros-disks and update-engine.
 
Cc: youcheng@chromium.org phoenixshen@chromium.org
Maybe adding </sbin/initctl emit started JOB=trunksd --no-wait> would help - not sure.

Project Member

Comment 2 by bugdroid1@chromium.org, Jan 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/75382e829ad54d4db39a43743129030db96206a0

commit 75382e829ad54d4db39a43743129030db96206a0
Author: Hung-Te Lin <hungte@chromium.org>
Date: Tue Jan 03 10:15:42 2017

init: Allow executing extra commands when inhibited jobs was fired.

Upstart is a based on state machine so we sometimes need to do few things, for
example firing Upstart events, when a job was inhibited.

For example, if job A depends on job B and we only want to inhibit job B (i.e.,
job  A must be executed), then we have to send 'started JOB=B' for Upstart to
continue.

To support this, common.d/inhibited_jobs/* now supports shell scripts so we can
send extra events, or do something else when a job was inhibited.

BUG= chromium:677915 
TEST=Created 'trunksd' with 'initctl -n emit started JOB=trunksd' and see
     tpm_managerd was invoked.

Change-Id: Ic8f725660b7425d1a0de62299ced68691937456a
Reviewed-on: https://chromium-review.googlesource.com/424458
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Youcheng Syu <youcheng@google.com>

[modify] https://crrev.com/75382e829ad54d4db39a43743129030db96206a0/init/common.d/inhibit_jobs/README.md
[modify] https://crrev.com/75382e829ad54d4db39a43743129030db96206a0/init/common.d/inhibit_jobs/filter.sh

Project Member

Comment 3 by bugdroid1@chromium.org, Jan 23 2017

Labels: merge-merged-factory-gru-9017.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/c8d131200b1ae08079a07edd100553b3bf645e36

commit c8d131200b1ae08079a07edd100553b3bf645e36
Author: Hung-Te Lin <hungte@chromium.org>
Date: Tue Jan 03 10:15:42 2017

init: Allow executing extra commands when inhibited jobs was fired.

Upstart is a based on state machine so we sometimes need to do few things, for
example firing Upstart events, when a job was inhibited.

For example, if job A depends on job B and we only want to inhibit job B (i.e.,
job  A must be executed), then we have to send 'started JOB=B' for Upstart to
continue.

To support this, common.d/inhibited_jobs/* now supports shell scripts so we can
send extra events, or do something else when a job was inhibited.

BUG= chromium:677915 
TEST=Created 'trunksd' with 'initctl -n emit started JOB=trunksd' and see
     tpm_managerd was invoked.

Change-Id: Ic8f725660b7425d1a0de62299ced68691937456a
Reviewed-on: https://chromium-review.googlesource.com/424458
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Youcheng Syu <youcheng@google.com>
(cherry picked from commit 75382e829ad54d4db39a43743129030db96206a0)
Reviewed-on: https://chromium-review.googlesource.com/430524
Commit-Queue: Youcheng Syu <youcheng@google.com>
Tested-by: Youcheng Syu <youcheng@google.com>

[modify] https://crrev.com/c8d131200b1ae08079a07edd100553b3bf645e36/init/common.d/inhibit_jobs/README.md
[modify] https://crrev.com/c8d131200b1ae08079a07edd100553b3bf645e36/init/common.d/inhibit_jobs/filter.sh

Comment 4 by hungte@chromium.org, Jan 25 2017

Owner: hungte@chromium.org
Status: Fixed (was: Untriaged)
I think we've learned a lot, probably enough.

Comment 5 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 6 by dchan@google.com, May 30 2017

Labels: VerifyIn-60

Comment 7 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61

Comment 8 by dchan@chromium.org, Oct 14 2017

Status: Archived (was: Fixed)

Sign in to add a comment