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

Issue 11477012: Workaround #6986. (Closed)

Created:
8 years ago by Bob Nystrom
Modified:
8 years ago
CC:
reviews_dartlang.org, Mads Ager (google)
Visibility:
Public.

Description

Workaround #6986. This avoids trying to read a non-existent lockfile. On some non-English locales, this fails when trying to parse the error message coming from Windows. BUG=6986 Committed: https://code.google.com/p/dart/source/detail?r=15992

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -17 lines) Patch
M utils/pub/entrypoint.dart View 1 chunk +6 lines, -17 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Bob Nystrom
This should avoid the issue in almost all cases, and I think the code is ...
8 years ago (2012-12-11 18:31:59 UTC) #1
Mads Ager (google)
LGTM Thanks Bob! This looks cleaner to me too. I'll get the issue with localized ...
8 years ago (2012-12-11 18:39:20 UTC) #2
nweiz
Please add a comment indicating that this is a workaround of issue 6986 -- maybe ...
8 years ago (2012-12-11 20:22:50 UTC) #3
Bob Nystrom
On 2012/12/11 20:22:50, nweiz wrote: > Please add a comment indicating that this is a ...
8 years ago (2012-12-11 20:35:17 UTC) #4
nweiz
8 years ago (2012-12-11 20:39:35 UTC) #5
Message was sent while issue was closed.
On 2012/12/11 20:35:17, Bob Nystrom wrote:
> On 2012/12/11 20:22:50, nweiz wrote:
> > Please add a comment indicating that this is a workaround of issue 6986 --
> maybe
> > with a brief explanation of what that issue is, since it's a bit hard to
tell
> by
> > just glancing at the bug.
> 
> I actually think the code is a bit cleaner after the patch. We were still
doing
> a second exists() check in the original code, so the "try read and handle
> failure" pattern doesn't actually avoid the potential race condition. Given
> that, I think the new code is just fine to keep even after that bug is fixed.

We should have been checking the osError field of the FileIOException to see if
it failed because the file didn't exist -- that would prevent the race condition
there.

This code also recovers less gracefully if a lockfile exists but is unreadable.

Powered by Google App Engine
This is Rietveld 408576698