New issue
Advanced search Search tips

Issue 876424 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Fix race condition in component updater

Project Member Reported by tiborg@chromium.org, Aug 21

Issue description

Component registrations are async. This causes problems with the new Android background task update scheduler where we sometimes want to fire component updates before the components are registered (see issue 867354). We are currently pursuing a workaround where we add some delay before firing the component update to give all components time to register. That is not great. It would be better to solve this problem in a more principled way. For instance, we could add a callback that fires after all components have finished registering and only then run the update task.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 22

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8546bfb21883003190f005495700ff95c997935d

commit 8546bfb21883003190f005495700ff95c997935d
Author: Tibor Goldschwendt <tiborg@chromium.org>
Date: Wed Aug 22 18:30:59 2018

[component updater] Fix race condition in background task scheduler

If the background task scheduler started Chrome it could happen that we
wanted to schedule a component update before the update callback was
set. This caused seg faults. Instead, add a delay to give enough time
for all components to finish registering and set the update callback. If
there is still no update callback set finish the task and retry after a
default delay.

Bug: 867354, 876424
Change-Id: I3ef8277a4e45384531a08652d5534831f8fd2056
Reviewed-on: https://chromium-review.googlesource.com/1183961
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585177}
[modify] https://crrev.com/8546bfb21883003190f005495700ff95c997935d/chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java
[modify] https://crrev.com/8546bfb21883003190f005495700ff95c997935d/chrome/browser/android/component_updater/background_task_update_scheduler.cc
[modify] https://crrev.com/8546bfb21883003190f005495700ff95c997935d/chrome/browser/android/component_updater/background_task_update_scheduler.h

Sign in to add a comment