DescriptionSync: Avoid deadlock in SyncBackendRegistrar / ModelSafeWorker on sync backend shutdown.
This is a resubmit of the previous fix that has been reverted due to the
flaky unittest that would hang under the load:
https://codereview.chromium.org/637413003
Please see delta between patch sets 1 and 2 for the
unit test fix.
The test would hang due to a race condition between
MessageLoop::RunUntilIdle call for the main UI thread and
submitting a task on the UI thread from SyncBackendRegistrar running on the sync thread.
The new test implementation runs the UI thread loop continuously
until the expected result is reached so that eliminates the
race condition and makes the test simpler.
I verified the fix by running the test while running
Chromium build in background. Using this method I reliably
reproduced the hang with the first implementation of the test.
This version of the test works reliably under the same condition.
BUG=423078
Committed: https://crrev.com/df486a3cbdad2025fff98fa497edb1261e83435c
Cr-Commit-Position: refs/heads/master@{#301056}
Patch Set 1 #Patch Set 2 : Fixed hang in the unit test #
Total comments: 2
Patch Set 3 : Use RunLoop instead of deprecated MessageLoop::Run in the test. #Patch Set 4 : Addressed CR feedback and verified under valgrind #
Total comments: 8
Patch Set 5 : Addressed second round of CR feedback #Patch Set 6 : Fixed linux_clang_tsan warning about lock-order-inversion #
Messages
Total messages: 10 (2 generated)
|