summaryrefslogtreecommitdiff
path: root/common/action_processor.cc
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2015-12-04 13:56:25 -0800
committerAlex Deymo <deymo@google.com>2015-12-04 15:40:03 -0800
commit2b4268c8f89d115b0895b3f0172f42c11d9b1d7c (patch)
treefe41fd2a96b4a942a0165165a3abac0a09e2a521 /common/action_processor.cc
parentab49446e3d08dc8cf8928c3d3b6f292513af5566 (diff)
Fix crash on shutdown when update in progress.
The ActionProcessor destructor normally calls the ProcessingStop method on the delegate. For the UpdateAttempter this call re-schedules a new update attempt on a half-destroyed update_attempter instance, crashing update_engine on SIGTERM when the ActionProcessor was running. This patch inhibits the ActionProcessor from notifying the delegate of the processor stopping when destroying the update_attempter instance. It also fixes the declaration order of the dbus_adaptor_ and disables its usage during daemon shutdown. Bug: 24989397 TEST=start update-engine; (update_engine_client --update &); sleep 6; stop update-engine; tail /var/log/update_engine.log TEST=FEATURES=test emerge-link update_engine Change-Id: I0a40067f63e89759ff80c79cecb6f89b10dba0c2
Diffstat (limited to 'common/action_processor.cc')
-rw-r--r--common/action_processor.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/common/action_processor.cc b/common/action_processor.cc
index c5270a48..7ccdfbd3 100644
--- a/common/action_processor.cc
+++ b/common/action_processor.cc
@@ -30,13 +30,10 @@ ActionProcessor::ActionProcessor()
: current_action_(nullptr), delegate_(nullptr) {}
ActionProcessor::~ActionProcessor() {
- if (IsRunning()) {
+ if (IsRunning())
StopProcessing();
- }
- for (std::deque<AbstractAction*>::iterator it = actions_.begin();
- it != actions_.end(); ++it) {
- (*it)->SetProcessor(nullptr);
- }
+ for (auto action : actions_)
+ action->SetProcessor(nullptr);
}
void ActionProcessor::EnqueueAction(AbstractAction* action) {