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

Issue 334593004: Fix race condition on ManifestService initialization. (Closed)

Created:
6 years, 6 months ago by hidehiko
Modified:
6 years, 6 months ago
Reviewers:
Mark Seaborn, teravest
CC:
chromium-reviews, dmichael (off chromium), hamaji, mazda
Project:
chromium
Visibility:
Public.

Description

Fix race condition on ManifestService initialization. SyncMessageFilter::Send() returns false immediately, if the IPC connection is not yet established. As connecting is done asynchronously, there is no guarantee that the connection is established on the first Send() invocation. By this CL, Send() blocks the caller thread if the connection is not yet established. Note that currently the ratio should be probably low, because there are some more initialization steps between the ManifestService creation and the first Send() invocation. We're switching to changing the initialization procedure, and then this race would be hit more easily. TEST=Ran browser_tests --gtest_filter=*NonSfi*:*NonSFI* locally, and trybots. Also, locally modified the code to delay OnFilterAdded with and without this CL, and made sure this CL works well. BUG=333950 CQ_EXTRA_TRYBOTS=tryserver.chromium:linux_rel_precise32 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277840

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Total comments: 2

Patch Set 3 : Rebase #

Total comments: 1

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -1 line) Patch
M ppapi/nacl_irt/manifest_service.cc View 1 2 3 1 chunk +44 lines, -1 line 0 comments Download

Messages

Total messages: 23 (0 generated)
hidehiko
Hi Mark, Justin, During the investigation of SRPC -> IPC switching, I found a race ...
6 years, 6 months ago (2014-06-12 10:17:26 UTC) #1
teravest
Hidehiko, Reading through the IPC code, I don't see how this is the case: "SyncMessageFilter::Send() ...
6 years, 6 months ago (2014-06-12 14:29:39 UTC) #2
hidehiko
Hi, On 2014/06/12 14:29:39, teravest wrote: > Hidehiko, > > Reading through the IPC code, ...
6 years, 6 months ago (2014-06-12 14:41:27 UTC) #3
teravest
lgtm OK, Thanks for explaining.
6 years, 6 months ago (2014-06-12 14:42:50 UTC) #4
Mark Seaborn
Is there a place where you can add a sleep() call that makes the race ...
6 years, 6 months ago (2014-06-13 00:34:35 UTC) #5
hidehiko
Thank you for review. PTAL. > Is there a place where you can add a ...
6 years, 6 months ago (2014-06-13 04:37:10 UTC) #6
Mark Seaborn
On 2014/06/13 04:37:10, hidehiko wrote: > Thank you for review. PTAL. Rubber-stamp LGTM (since Justin ...
6 years, 6 months ago (2014-06-13 16:40:48 UTC) #7
hidehiko
Thank you for review. Submitting. https://codereview.chromium.org/334593004/diff/60001/ppapi/nacl_irt/manifest_service.cc File ppapi/nacl_irt/manifest_service.cc (right): https://codereview.chromium.org/334593004/diff/60001/ppapi/nacl_irt/manifest_service.cc#newcode20 ppapi/nacl_irt/manifest_service.cc:20: // IPC channel is ...
6 years, 6 months ago (2014-06-16 03:39:44 UTC) #8
hidehiko
The CQ bit was checked by hidehiko@chromium.org
6 years, 6 months ago (2014-06-16 03:39:57 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hidehiko@chromium.org/334593004/100001
6 years, 6 months ago (2014-06-16 03:40:16 UTC) #10
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-16 07:31:32 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: linux_rel_precise32 on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_rel_precise32/builds/642)
6 years, 6 months ago (2014-06-16 07:31:33 UTC) #12
hidehiko
The CQ bit was checked by hidehiko@chromium.org
6 years, 6 months ago (2014-06-16 07:36:31 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hidehiko@chromium.org/334593004/100001
6 years, 6 months ago (2014-06-16 07:37:24 UTC) #14
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-16 07:39:11 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_rel_precise32 on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_rel_precise32/builds/644)
6 years, 6 months ago (2014-06-16 07:39:12 UTC) #16
hidehiko
The CQ bit was checked by hidehiko@chromium.org
6 years, 6 months ago (2014-06-16 16:34:27 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hidehiko@chromium.org/334593004/100001
6 years, 6 months ago (2014-06-16 16:35:33 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-16 16:38:13 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: linux_rel_precise32 on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_rel_precise32/builds/646)
6 years, 6 months ago (2014-06-16 16:38:14 UTC) #20
hidehiko
The CQ bit was checked by hidehiko@chromium.org
6 years, 6 months ago (2014-06-17 17:56:26 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hidehiko@chromium.org/334593004/100001
6 years, 6 months ago (2014-06-17 17:58:17 UTC) #22
commit-bot: I haz the power
6 years, 6 months ago (2014-06-17 20:06:34 UTC) #23
Message was sent while issue was closed.
Change committed as 277840

Powered by Google App Engine
This is Rietveld 408576698