Skip to content

Commit

Permalink
[ThreadPool] Fix unlikely race in ThreadPoolImplTest.FileDescriptorWa…
Browse files Browse the repository at this point in the history
…tcherNoOpsAfterShutdown

R=etiennep@chromium.org

Bug: 965717
Change-Id: Ie7185cd0afc819d612368c6ce168a1544b2a64af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1654271
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#668476}
  • Loading branch information
Gabriel Charette authored and Commit Bot committed Jun 12, 2019
1 parent 037c5c0 commit 8c8f3ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions base/task/thread_pool/thread_pool_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,12 @@ TEST_P(ThreadPoolImplTest, FileDescriptorWatcherNoOpsAfterShutdown) {
// Give a chance for the file watcher to fire before closing the handles.
PlatformThread::Sleep(TestTimeouts::tiny_timeout());

// Need to join the ServiceThread before closing the pipes as the pipe
// becoming readable is observed on the ServiceThread and TSAN correctly
// identifies this as a race even though the above sleep makes it highly
// unlikely in practice.
TearDown();

EXPECT_EQ(0, IGNORE_EINTR(close(pipes[0])));
EXPECT_EQ(0, IGNORE_EINTR(close(pipes[1])));
}
Expand Down
4 changes: 0 additions & 4 deletions build/sanitizers/tsan_suppressions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ char kTSanDefaultSuppressions[] =
// http://crbug.com/927330
"race:net::(anonymous namespace)::g_network_change_notifier\n"

// https://crbug.com/965717
"race:base::internal::ThreadPoolImplTest_"
"FileDescriptorWatcherNoOpsAfterShutdown_Test::TestBody\n"

// https://crbug.com/965722
"race:content::(anonymous namespace)::CorruptDBRequestHandler\n"

Expand Down

0 comments on commit 8c8f3ab

Please sign in to comment.