update_engine: Use a second ActionProcessor for UpdateBootFlagsAction
The crrev.com/c/2519843 mistenly merged an ActionProcessor from
RealSystemState to the one in UpdateAttempter. This is problematic
because these two ActionProcessors used to run at different times (and
sometimes simultanously) and on different objects. But after they were
merge, they are colliding. For example UpdateAttempter::StartUpdater()
is adding Actions that run 45 seconds later, but the
UpdateAttempter::Update() starts the same ActionProcessor which is a
bug.
BUG=b:173251868
TEST=emerge and cros deployed, then run:
test_that --args="job_repo_url=http://100.115.168.195:8082/static/reef-release/R88-13591.0.0/autotest/packages" chromeos6-row3-rack10-host7.cros autoupdate_ForcedOOBEUpdate.full
Change-Id: I7716e9ae2e77bbc4caff5273cd3fbc22e1ed7f5b
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2542962
Commit-Queue: Amin Hassani <[email protected]>
Tested-by: Amin Hassani <[email protected]>
Auto-Submit: Amin Hassani <[email protected]>
Reviewed-by: Jae Hoon Kim <[email protected]>
(cherry picked from commit 1e19be33e983e23d4d7e35096f95fe0ac33d6ab6)
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2546037
Reviewed-by: Amin Hassani <[email protected]>
diff --git a/cros/update_attempter.cc b/cros/update_attempter.cc
index 5c21d04..48a4667 100644
--- a/cros/update_attempter.cc
+++ b/cros/update_attempter.cc
@@ -189,12 +189,12 @@
auto update_boot_flags_action =
std::make_unique<UpdateBootFlagsAction>(system_state_->boot_control());
- processor_->EnqueueAction(std::move(update_boot_flags_action));
+ aux_processor_.EnqueueAction(std::move(update_boot_flags_action));
// Update boot flags after 45 seconds.
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&ActionProcessor::StartProcessing,
- base::Unretained(processor_.get())),
+ base::Unretained(&aux_processor_)),
base::TimeDelta::FromSeconds(45));
// Broadcast the update engine status on startup to ensure consistent system
diff --git a/cros/update_attempter.h b/cros/update_attempter.h
index 24c6f54..a866d7b 100644
--- a/cros/update_attempter.h
+++ b/cros/update_attempter.h
@@ -460,6 +460,8 @@
std::unique_ptr<ActionProcessor> processor_;
+ ActionProcessor aux_processor_;
+
// External state of the system outside the update_engine process
// carved out separately to mock out easily in unit tests.
SystemState* system_state_;