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

Issue 2617253002: Fix a GN race condition. (Closed)

Created:
3 years, 11 months ago by brettw
Modified:
3 years, 11 months ago
CC:
chromium-reviews, Dirk Pranke, agrieve+watch_chromium.org, tfarina, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix a GN race condition. The loader maintains a reference count on the "pending work". But the Setup object was starting the load before incrementing this reference count. It the loader happened to load anything on the background thread before the main thread could increment the reference count, GN would think there is no work left and exit early. There is another possible race condition between defining items and doing work on the thread pool can cause the build to be marked complete before everything is actually done. The race condition is described in more detail in the added comment in setup.cc. BUG=674213 Review-Url: https://codereview.chromium.org/2617253002 Cr-Commit-Position: refs/heads/master@{#442416} Committed: https://chromium.googlesource.com/chromium/src/+/717182cd794aae4577fbae651a88e3ba6d973dc8

Patch Set 1 #

Patch Set 2 : Fix #

Patch Set 3 : Fix other race condition. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -4 lines) Patch
M tools/gn/setup.cc View 1 2 2 chunks +20 lines, -4 lines 0 comments Download

Messages

Total messages: 28 (16 generated)
brettw
Fix
3 years, 11 months ago (2017-01-06 23:52:41 UTC) #1
brettw
3 years, 11 months ago (2017-01-06 23:55:25 UTC) #6
Dirk Pranke
lgtm
3 years, 11 months ago (2017-01-06 23:58:37 UTC) #8
tsniatowski
On 2017/01/06 23:58:37, Dirk Pranke wrote: > lgtm Unfortunately I can still observe the issue ...
3 years, 11 months ago (2017-01-07 09:05:21 UTC) #11
brettw
Hmm, I';m pretty sure the issue I described is real, but there may be a ...
3 years, 11 months ago (2017-01-07 18:57:29 UTC) #12
tsniatowski
On 2017/01/07 18:57:29, brettw (ping after 24h) wrote: > Hmm, I';m pretty sure the issue ...
3 years, 11 months ago (2017-01-08 10:00:48 UTC) #13
brettw
Thanks, on my beefy dev box using "stress --cpu 48" gives an occasional "no targets" ...
3 years, 11 months ago (2017-01-09 20:07:09 UTC) #14
brettw
Okay, I found an even more obvious race which is probably what we're normally encountering. ...
3 years, 11 months ago (2017-01-09 22:29:55 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2617253002/40001
3 years, 11 months ago (2017-01-09 23:44:10 UTC) #23
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/717182cd794aae4577fbae651a88e3ba6d973dc8
3 years, 11 months ago (2017-01-10 00:25:52 UTC) #26
tsniatowski
On 2017/01/09 22:29:55, brettw (ping after 24h) wrote: > Okay, I found an even more ...
3 years, 11 months ago (2017-01-10 08:07:56 UTC) #27
brettw
3 years, 11 months ago (2017-01-10 18:14:56 UTC) #28
Message was sent while issue was closed.
> Seems to have done the trick! Thanks!

Great, thanks for the help tracking this down!

Powered by Google App Engine
This is Rietveld 408576698