Commit ed47a6c1 authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

service worker: Add temporary instrumentation to debug startup failures.

Somehow service workers are timing out and I don't see what could have
changed. We are timing out in "Allocate Process" before a Start mesage
is sent to the renderer, which suggests some thread on the brower
process is hung somewhere. Try to get more info by generating a crash
report which will also let us see if any unusual command line flags
or features are enabled.

Bug: 843456
Change-Id: Ia4f8d8506e02ef0f0166530172ef033c300a1494
Reviewed-on: https://chromium-review.googlesource.com/1063571Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559447}
parent b81d0e7f
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <string> #include <string>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/dump_without_crashing.h"
#include "base/guid.h" #include "base/guid.h"
#include "base/location.h" #include "base/location.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
...@@ -1792,6 +1793,15 @@ void ServiceWorkerVersion::RecordStartWorkerResult( ...@@ -1792,6 +1793,15 @@ void ServiceWorkerVersion::RecordStartWorkerResult(
UMA_HISTOGRAM_ENUMERATION("ServiceWorker.StartWorker.TimeoutPhase", UMA_HISTOGRAM_ENUMERATION("ServiceWorker.StartWorker.TimeoutPhase",
phase, phase,
EmbeddedWorkerInstance::STARTING_PHASE_MAX_VALUE); EmbeddedWorkerInstance::STARTING_PHASE_MAX_VALUE);
if (IsInstalled(prestart_status) && !s_dumped_for_timeout_) {
// TODO(crbug.com/843456): Remove this instrumentation when the linked bug
// is fixed.
s_dumped_for_timeout_ = true;
DEBUG_ALIAS_FOR_GURL(script_url, script_url_);
base::debug::Alias(&phase);
base::debug::DumpWithoutCrashing();
}
} }
bool ServiceWorkerVersion::MaybeTimeoutRequest( bool ServiceWorkerVersion::MaybeTimeoutRequest(
...@@ -2015,4 +2025,7 @@ bool ServiceWorkerVersion::IsStartWorkerAllowed() const { ...@@ -2015,4 +2025,7 @@ bool ServiceWorkerVersion::IsStartWorkerAllowed() const {
return true; return true;
} }
// static
bool ServiceWorkerVersion::s_dumped_for_timeout_ = false;
} // namespace content } // namespace content
...@@ -864,6 +864,8 @@ class CONTENT_EXPORT ServiceWorkerVersion ...@@ -864,6 +864,8 @@ class CONTENT_EXPORT ServiceWorkerVersion
base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
static bool s_dumped_for_timeout_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment