Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Issue 1187623006: Service Worker: Update stale workers (Closed)

Created:
5 years, 6 months ago by falken
Modified:
5 years, 6 months ago
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, darin-cc_chromium.org, horo+watch_chromium.org, kinuko+serviceworker, kinuko+watch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Service Worker: Update stale workers Before this patch we only update a worker on main resource navigation inside its scope. This means a Push-only SW for which you don't navigate to its scope is never updated. This patch introduces a way to update "stale" workers. A worker that hasn't been checked for update from the network for over 24 hours is considered stale. We check for staleness when a worker starts up and periodically while it's running. We try to update stale workers once they stop (one reason is that skipWaiting() may kick out the worker before it finished handling the event that triggered the staleness check; also want to avoid network contention while the incumbent is handling an event). However if a worker is running too long, an update may be triggered (otherwise, a constant stream of events keeping the worker alive would prevent it from ever updating). BUG=477598 TEST=ServiceWorkerVersionTest.StaleUpdate* Committed: https://crrev.com/13053b7698140f33fc71dd7ab92b01ef3ec45551 Cr-Commit-Position: refs/heads/master@{#335901}

Patch Set 1 #

Patch Set 2 : safer reg holding #

Total comments: 9

Patch Set 3 : rebase #

Patch Set 4 : review comments #

Total comments: 4

Patch Set 5 : fix asan and give name to 24 hour check #

Patch Set 6 : self-review #

Patch Set 7 : rebase #

Total comments: 4

Patch Set 8 : review comments #

Patch Set 9 : fix DCHECK #

Messages

Total messages: 37 (13 generated)
falken
PTAL nhiroki, kinuko: all peter: FYI, does this solve your use case? michaeln: FYI if ...
5 years, 6 months ago (2015-06-18 09:05:57 UTC) #2
Peter Beverloo
Yes, this seems great from our POV. Thanks! https://codereview.chromium.org/1187623006/diff/20001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1187623006/diff/20001/content/browser/service_worker/service_worker_version.cc#newcode64 content/browser/service_worker/service_worker_version.cc:64: const ...
5 years, 6 months ago (2015-06-18 14:08:58 UTC) #3
nhiroki
Looks good overall. Can you fix test failure on linux_asan bot? https://codereview.chromium.org/1187623006/diff/20001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): ...
5 years, 6 months ago (2015-06-22 05:16:56 UTC) #4
falken
Thanks for reviews! https://codereview.chromium.org/1187623006/diff/20001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1187623006/diff/20001/content/browser/service_worker/service_worker_version.cc#newcode64 content/browser/service_worker/service_worker_version.cc:64: const int kUpdateStaleWorkerSeconds = 30; On ...
5 years, 6 months ago (2015-06-22 08:05:44 UTC) #5
nhiroki
lgtm https://codereview.chromium.org/1187623006/diff/20001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1187623006/diff/20001/content/browser/service_worker/service_worker_version.cc#newcode626 content/browser/service_worker/service_worker_version.cc:626: base::Bind(&ServiceWorkerVersion::FoundRegistrationForUpdate, this)); On 2015/06/22 08:05:44, falken wrote: > ...
5 years, 6 months ago (2015-06-22 08:39:17 UTC) #6
falken
On 2015/06/22 08:39:17, nhiroki wrote: > lgtm > > https://codereview.chromium.org/1187623006/diff/20001/content/browser/service_worker/service_worker_version.cc > File content/browser/service_worker/service_worker_version.cc (right): > ...
5 years, 6 months ago (2015-06-22 08:43:59 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1187623006/60001
5 years, 6 months ago (2015-06-22 08:44:20 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/19971)
5 years, 6 months ago (2015-06-22 09:57:03 UTC) #11
kinuko
https://codereview.chromium.org/1187623006/diff/60001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1187623006/diff/60001/content/browser/service_worker/service_worker_version.cc#newcode609 content/browser/service_worker/service_worker_version.cc:609: base::Bind(&ServiceWorkerVersion::StartUpdate, this)); Hmm. This one makes the timer's internal ...
5 years, 6 months ago (2015-06-22 14:02:53 UTC) #12
kinuko
https://codereview.chromium.org/1187623006/diff/60001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1187623006/diff/60001/content/browser/service_worker/service_worker_version.cc#newcode609 content/browser/service_worker/service_worker_version.cc:609: base::Bind(&ServiceWorkerVersion::StartUpdate, this)); Maybe we could rely on context or ...
5 years, 6 months ago (2015-06-22 14:21:09 UTC) #13
falken
https://codereview.chromium.org/1187623006/diff/60001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1187623006/diff/60001/content/browser/service_worker/service_worker_version.cc#newcode609 content/browser/service_worker/service_worker_version.cc:609: base::Bind(&ServiceWorkerVersion::StartUpdate, this)); On 2015/06/22 14:21:09, kinuko wrote: > Maybe ...
5 years, 6 months ago (2015-06-23 07:53:27 UTC) #14
falken
Updated to have context core keep the version alive. PTAL.
5 years, 6 months ago (2015-06-23 09:48:52 UTC) #17
kinuko
lgtm
5 years, 6 months ago (2015-06-23 14:30:49 UTC) #18
nhiroki
Still lgtm. Can you add TEST= line? https://codereview.chromium.org/1187623006/diff/160001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/1187623006/diff/160001/content/browser/service_worker/service_worker_version.cc#newcode614 content/browser/service_worker/service_worker_version.cc:614: context_->ProtectVersion(make_scoped_refptr(this)); Can ...
5 years, 6 months ago (2015-06-24 05:14:42 UTC) #19
falken
Thanks, updated. > Can you add TEST= line? Added this time. A long time ago, ...
5 years, 6 months ago (2015-06-24 07:58:11 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1187623006/180001
5 years, 6 months ago (2015-06-24 07:59:09 UTC) #23
nhiroki
On 2015/06/24 07:58:11, falken wrote: > Thanks, updated. > > > Can you add TEST= ...
5 years, 6 months ago (2015-06-24 08:16:40 UTC) #24
commit-bot: I haz the power
Exceeded global retry quota
5 years, 6 months ago (2015-06-24 08:29:26 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1187623006/180001
5 years, 6 months ago (2015-06-24 08:37:53 UTC) #28
commit-bot: I haz the power
Exceeded global retry quota
5 years, 6 months ago (2015-06-24 08:45:13 UTC) #30
falken
Updated the patch to fix DCHECK failures. Some tests call StartUpdate directly and would attempt ...
5 years, 6 months ago (2015-06-24 10:02:52 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1187623006/220001
5 years, 6 months ago (2015-06-24 10:03:23 UTC) #35
commit-bot: I haz the power
Committed patchset #9 (id:220001)
5 years, 6 months ago (2015-06-24 11:02:09 UTC) #36
commit-bot: I haz the power
5 years, 6 months ago (2015-06-24 11:03:12 UTC) #37
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/13053b7698140f33fc71dd7ab92b01ef3ec45551
Cr-Commit-Position: refs/heads/master@{#335901}

Powered by Google App Engine
This is Rietveld 408576698