Commit 1e7bfdb2 authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Fix DCHECK-only race condition in ProxyResolverV8TracingImpl

Bug: 699562
Change-Id: I9c818a0c0c490b2d32929a9867d5d3bebf6e8ca9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1618016
Auto-Submit: David Benjamin <davidben@chromium.org>
Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661014}
parent 7d18e3fc
......@@ -183,10 +183,6 @@ char kTSanDefaultSuppressions[] =
// http://crbug.com/633145
"race:third_party/libjpeg_turbo/simd/jsimd_x86_64.c\n"
// http://crbug.com/v8/6065
"race:net::(anonymous namespace)::ProxyResolverV8TracingImpl::RequestImpl"
"::~RequestImpl()\n"
// http://crbug.com/691029
"deadlock:libGLX.so*\n"
......
......@@ -406,7 +406,12 @@ void Job::Cancel() {
ReleaseCallback();
pending_dns_.reset();
// Note we only mutate |pending_dns_| if it is non-null. If it is null, the
// worker thread may be about to request a new DNS resolution. This avoids a
// race condition with the DCHECK in PostDnsOperationAndWait().
// See https://crbug.com/699562.
if (pending_dns_)
pending_dns_.reset();
// The worker thread might be blocked waiting for DNS.
event_.Signal();
......@@ -695,7 +700,9 @@ bool Job::ResolveDnsNonBlocking(const std::string& host,
bool Job::PostDnsOperationAndWait(const std::string& host,
ProxyResolveDnsOperation op,
bool* completed_synchronously) {
// Post the DNS request to the origin thread.
// Post the DNS request to the origin thread. It is safe to mutate
// |pending_dns_host_| and |pending_dns_op_| because there cannot be another
// DNS operation in progress or scheduled.
DCHECK(!pending_dns_);
pending_dns_host_ = host;
pending_dns_op_ = op;
......
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