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

Issue 962543005: Service Worker: Add metrics and timeout for starting a Service Worker. (Closed)

Created:
5 years, 9 months ago by falken
Modified:
5 years, 9 months ago
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, mlamouri+watch-content_chromium.org, tzik, serviceworker-reviews, jam, nhiroki, darin-cc_chromium.org, asvitkine+watch_chromium.org, horo+watch_chromium.org, mkwst+moarreviews-renderer_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: Add metrics and timeout for starting a Service Worker. There are some reports of SW getting wedged in the "STARTING" state. This CL adds metrics to understand the issue and a timeout for aborting start so that retrying might succeed. The timeout is 5 minutes (same as the limit for events proposed in crbug.com/372436). We already have a timeout for 30 seconds of script evaluation, so this new timeout covers possible failures like getting stuck trying to allocate a process or waiting for an ack from the renderer. 5 minutes may be too harsh for users on slow connections, so future work on some sort of exponential backoff or varying the limit for new vs installed workers may be possible. An existing issue is the 30 second timeout for script evaluation includes importScripts(), which could potentially take a long time downloading scripts. BUG=448003 Committed: https://crrev.com/292e84ac2c4a0b0074d5ece1eabfebec7fed1ebb Cr-Commit-Position: refs/heads/master@{#319262}

Patch Set 1 #

Patch Set 2 : fix #

Patch Set 3 : self-review #

Total comments: 14

Patch Set 4 : sync #

Patch Set 5 : review comments #

Total comments: 3

Patch Set 6 : review #

Total comments: 11

Patch Set 7 : review comments #

Patch Set 8 : add comment #

Total comments: 4

Patch Set 9 : review comments #

Patch Set 10 : sync #

Patch Set 11 : sync again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+289 lines, -22 lines) Patch
M content/browser/notifications/notification_event_dispatcher_impl.cc View 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/push_messaging/push_messaging_message_filter.cc View 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/push_messaging/push_messaging_router.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.h View 1 2 3 4 5 6 7 4 chunks +22 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.cc View 1 2 3 4 7 chunks +48 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_register_job.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_registration_status.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 4 5 6 7 8 9 10 5 chunks +13 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 4 5 6 7 8 9 10 10 chunks +96 lines, -10 lines 0 comments Download
M content/browser/service_worker/service_worker_version_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +21 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_status_code.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_status_code.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.cc View 1 2 3 2 chunks +7 lines, -7 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 3 chunks +52 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (5 generated)
falken
PTAL. Depends on tiny issue https://codereview.chromium.org/964483004/
5 years, 9 months ago (2015-02-27 12:06:35 UTC) #2
kinuko
Looking good. Having version.cc overloaded with more times concerns me a bit, but for now ...
5 years, 9 months ago (2015-03-02 03:19:33 UTC) #3
falken
Thanks PTAL. > Having version.cc overloaded with more times concerns me a bit, but for ...
5 years, 9 months ago (2015-03-02 04:19:17 UTC) #4
kinuko
lgtm https://codereview.chromium.org/962543005/diff/40001/content/renderer/service_worker/embedded_worker_context_client.cc File content/renderer/service_worker/embedded_worker_context_client.cc (right): https://codereview.chromium.org/962543005/diff/40001/content/renderer/service_worker/embedded_worker_context_client.cc#newcode227 content/renderer/service_worker/embedded_worker_context_client.cc:227: weak_factory_.GetWeakPtr())); On 2015/03/02 04:19:17, falken wrote: > On ...
5 years, 9 months ago (2015-03-02 06:13:19 UTC) #5
falken
Thanks. https://codereview.chromium.org/962543005/diff/40001/content/renderer/service_worker/embedded_worker_context_client.cc File content/renderer/service_worker/embedded_worker_context_client.cc (right): https://codereview.chromium.org/962543005/diff/40001/content/renderer/service_worker/embedded_worker_context_client.cc#newcode227 content/renderer/service_worker/embedded_worker_context_client.cc:227: weak_factory_.GetWeakPtr())); On 2015/03/02 06:13:19, kinuko wrote: > On ...
5 years, 9 months ago (2015-03-02 06:33:16 UTC) #6
falken
asvitkine: histograms. I also have a question, is it possible for the histogram enums to ...
5 years, 9 months ago (2015-03-02 06:36:22 UTC) #8
Peter Beverloo
push and notifications lgtm % nit https://codereview.chromium.org/962543005/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/962543005/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode555 content/browser/push_messaging/push_messaging_message_filter.cc:555: case SERVICE_WORKER_ERROR_TIMEOUT: nit: ...
5 years, 9 months ago (2015-03-02 14:23:38 UTC) #9
Peter Beverloo
https://codereview.chromium.org/962543005/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/962543005/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode555 content/browser/push_messaging/push_messaging_message_filter.cc:555: case SERVICE_WORKER_ERROR_TIMEOUT: On 2015/03/02 14:23:37, Peter Beverloo wrote: > ...
5 years, 9 months ago (2015-03-02 14:26:02 UTC) #10
falken
https://codereview.chromium.org/962543005/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/962543005/diff/100001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode555 content/browser/push_messaging/push_messaging_message_filter.cc:555: case SERVICE_WORKER_ERROR_TIMEOUT: On 2015/03/02 14:26:01, Peter Beverloo wrote: > ...
5 years, 9 months ago (2015-03-02 14:44:03 UTC) #11
Alexei Svitkine (slow)
+rkaplow, could you do an initial histograms review?
5 years, 9 months ago (2015-03-02 16:30:13 UTC) #13
rkaplow
https://codereview.chromium.org/962543005/diff/100001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/962543005/diff/100001/content/browser/service_worker/service_worker_version.cc#newcode9 content/browser/service_worker/service_worker_version.cc:9: #include "base/metrics/histogram.h" histogram_macros.h https://codereview.chromium.org/962543005/diff/100001/content/browser/service_worker/service_worker_version.cc#newcode99 content/browser/service_worker/service_worker_version.cc:99: const int kDestructedStartingWorkerTimeoutThreshold = ...
5 years, 9 months ago (2015-03-03 15:58:41 UTC) #14
falken
Thanks for the review, just a comment for now to minimize time zone RTT. https://codereview.chromium.org/962543005/diff/100001/content/browser/service_worker/service_worker_version.cc ...
5 years, 9 months ago (2015-03-03 16:23:58 UTC) #15
rkaplow
https://codereview.chromium.org/962543005/diff/100001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/962543005/diff/100001/content/browser/service_worker/service_worker_version.cc#newcode1560 content/browser/service_worker/service_worker_version.cc:1560: UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorkerVersion.StartWorkerTime", On 2015/03/03 16:23:58, falken wrote: > On 2015/03/03 ...
5 years, 9 months ago (2015-03-03 16:30:15 UTC) #16
falken
Thanks, updated. I guess that means we have to be careful not to change the ...
5 years, 9 months ago (2015-03-04 04:16:35 UTC) #17
rkaplow
lgtm
5 years, 9 months ago (2015-03-04 15:34:36 UTC) #18
falken
Thanks! avstikine: can you review as OWNER please?
5 years, 9 months ago (2015-03-04 15:38:18 UTC) #19
falken
On 2015/03/04 15:38:18, falken wrote: > Thanks! avstikine: can you review as OWNER please? err... ...
5 years, 9 months ago (2015-03-04 15:39:39 UTC) #20
Alexei Svitkine (slow)
https://codereview.chromium.org/962543005/diff/140001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/962543005/diff/140001/content/browser/service_worker/service_worker_version.cc#newcode1569 content/browser/service_worker/service_worker_version.cc:1569: std::string message = "ServiceWorker startup timed out. "; Normally, ...
5 years, 9 months ago (2015-03-04 15:46:38 UTC) #21
falken
Thanks, updated. https://codereview.chromium.org/962543005/diff/140001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/962543005/diff/140001/content/browser/service_worker/service_worker_version.cc#newcode1569 content/browser/service_worker/service_worker_version.cc:1569: std::string message = "ServiceWorker startup timed out. ...
5 years, 9 months ago (2015-03-05 08:33:12 UTC) #22
Alexei Svitkine (slow)
lgtm
5 years, 9 months ago (2015-03-05 15:45:49 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/962543005/200001
5 years, 9 months ago (2015-03-05 15:53:03 UTC) #26
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 9 months ago (2015-03-05 16:54:32 UTC) #27
commit-bot: I haz the power
5 years, 9 months ago (2015-03-05 16:55:38 UTC) #28
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/292e84ac2c4a0b0074d5ece1eabfebec7fed1ebb
Cr-Commit-Position: refs/heads/master@{#319262}

Powered by Google App Engine
This is Rietveld 408576698