New issue
Advanced search Search tips

Issue 636467 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: ----

Blocking:
issue 613765



Sign in to add a comment

the background cros_update process id is different with shell process id.

Project Member Reported by xixuan@chromium.org, Aug 10 2016

Issue description

In real test, when the devserver popen a background subprocess, the process id is different shell id, for example, the process id is 'sh -c python cros_update.py' is 1200, and the real process id of 'cros_update.py' is 1201, which leads to 'get_au_status_file' cannot read the status file, since the file identifier includes the process id.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/8ba0ed5d01af55a03d0ac569223b540f62d1786f

commit 8ba0ed5d01af55a03d0ac569223b540f62d1786f
Author: xixuan <xixuan@google.com>
Date: Wed Aug 10 19:15:16 2016

chromite: fetch 'stateful_update' script from devserver

This CL passes in devserver directory, and let the ChromiumOSUpdater to fetch
'stateful_update' script from that directory. This is due to the location of
the stateful update script on devserver is different from that on drone/shard.

BUG= chromium:636467 
TEST=local autotest to trigger repair & provision.
real test in devserver chromeos4-devserver2.
Ran unittest.

Change-Id: I72b0287aa5a931541e3d7ffdabc07252b7bf2440
Reviewed-on: https://chromium-review.googlesource.com/367537
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>

[modify] https://crrev.com/8ba0ed5d01af55a03d0ac569223b540f62d1786f/lib/auto_updater.py

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/dev-util/+/2a0970aab6e5453a2747ac7b856e66798da21be4

commit 2a0970aab6e5453a2747ac7b856e66798da21be4
Author: xixuan <xixuan@google.com>
Date: Wed Aug 10 19:12:44 2016

platform/dev: add 'chromite' import & process id handling.

Current devserver does not have 'chromite' dependency. Also, in real devserver,
the cros_update process's id is different from the shell id, and the
path of 'stateful_update' is different from that in drone/shard.

This CL:
1. add 'chromite' import
2. pass the 'devserver directory' to ChromiumOSUpdater.
3. Create a process group before newing the cros_update process. Use the
process group id as the unique file identifier. Kill the whole process group if
neccessary.

BUG= chromium:636467 
TEST=local autotest to trigger repair & provision.
real test in devserver chromeos4-devserver2.
pass testCROSAU in dev_integration_test.

Change-Id: Iddf7fcbcaf508b516a8c09bbe7b09fd7209c14a4
Reviewed-on: https://chromium-review.googlesource.com/367741
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/2a0970aab6e5453a2747ac7b856e66798da21be4/devserver_integration_test.py
[modify] https://crrev.com/2a0970aab6e5453a2747ac7b856e66798da21be4/cros_update.py
[modify] https://crrev.com/2a0970aab6e5453a2747ac7b856e66798da21be4/__init__.py
[modify] https://crrev.com/2a0970aab6e5453a2747ac7b856e66798da21be4/devserver.py

Project Member

Comment 3 by bugdroid1@chromium.org, Sep 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/dev-util/+/cf58dd3207f58a5d54540237d0c885ddcef8526e

commit cf58dd3207f58a5d54540237d0c885ddcef8526e
Author: xixuan <xixuan@google.com>
Date: Wed Aug 24 20:57:06 2016

platform/dev: add chromite import for internal use in package.

If dev is called as a package, __init__.py can offer a chromite dependency for
it. But __init__.py cannot handle the internal calls.

dev/
    __init__.py
    A.py
    B.py

C.py import package dev, and call functions in A.py, it will succeed.

But if B.py directly calls 'python A.py', or import A to call its funcions, it
will fail.

This CL handles this case.

BUG= chromium:636467 
TEST=locally run python cros_update.py, cros_update_progress.py. Run cros
flash.

Change-Id: I69d931b3a20a72a9e33f121f64382004f527cd42
Reviewed-on: https://chromium-review.googlesource.com/375040
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/cf58dd3207f58a5d54540237d0c885ddcef8526e/cros_update.py
[modify] https://crrev.com/cf58dd3207f58a5d54540237d0c885ddcef8526e/Makefile
[add] https://crrev.com/cf58dd3207f58a5d54540237d0c885ddcef8526e/setup_chromite.py
[modify] https://crrev.com/cf58dd3207f58a5d54540237d0c885ddcef8526e/__init__.py
[modify] https://crrev.com/cf58dd3207f58a5d54540237d0c885ddcef8526e/cros_update_progress.py

Status: Fixed (was: Assigned)

Sign in to add a comment