Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3584)

Issue 5966066: mac: Make ScopedRlzValueStoreLock handle nested lock failures. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by thakis
Modified:
12 years ago
CC:
rlz-codereviews_googlegroups.com, Roger Tawa
Base URL:
https://rlz.googlecode.com/svn/trunk
Visibility:
Public.

Description

mac: Make ScopedRlzValueStoreLock handle nested lock failures. I thought that lib_rlz always early-exits when it fails to acquire the rlz lock, and so nested lock acquisition failures should never happen. That is true as long as SupplementaryBranding isn't used, and that can even be used from user code like so: { rlz_lib::SupplementaryBranding branding(reactivation_brand.c_str()); ret &= rlz_lib::RecordProductEvent(product, point, event_id); } Since SupplementaryBranding tries to acquire the rlz lock and keeps it while it's on the scope, if RecordProductEvent fails to acquire the lock it'll be a nested lock failure. Update the code to not CHECK on this case. Add a test that covers this scenario. BUG=chromium:121255 TEST=unit test. I verified the test crashes in the CHECK without my code change.

Patch Set 1 #

Patch Set 2 : test #

Patch Set 3 : . #

Total comments: 5

Patch Set 4 : x #

Total comments: 6

Patch Set 5 : 0100 #

Patch Set 6 : comment #

Patch Set 7 : reviewers messing with me #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -9 lines) Patch
M lib/rlz_lib_test.cc View 1 2 3 4 5 6 1 chunk +37 lines, -0 lines 0 comments Download
M mac/lib/rlz_value_store_mac.mm View 1 1 chunk +8 lines, -9 lines 0 comments Download

Messages

Total messages: 9
thakis
https://codereview.appspot.com/5966066/diff/4001/lib/rlz_lib_test.cc File lib/rlz_lib_test.cc (right): https://codereview.appspot.com/5966066/diff/4001/lib/rlz_lib_test.cc#newcode801 lib/rlz_lib_test.cc:801: TEST_F(ReadonlyRlzDirectoryTest, WriteFails) { Both of the new tests take ...
12 years ago (2012-04-02 19:22:54 UTC) #1
Mark Mentovai
https://codereview.appspot.com/5966066/diff/4001/lib/rlz_lib_test.cc File lib/rlz_lib_test.cc (right): https://codereview.appspot.com/5966066/diff/4001/lib/rlz_lib_test.cc#newcode798 lib/rlz_lib_test.cc:798: chmod(temp_dir_.path().value().c_str(), 0400); A directory with mode 400 is useless! ...
12 years ago (2012-04-02 19:25:52 UTC) #2
thakis
https://codereview.appspot.com/5966066/diff/4001/lib/rlz_lib_test.cc File lib/rlz_lib_test.cc (right): https://codereview.appspot.com/5966066/diff/4001/lib/rlz_lib_test.cc#newcode798 lib/rlz_lib_test.cc:798: chmod(temp_dir_.path().value().c_str(), 0400); On 2012/04/02 19:25:52, Mark Mentovai wrote: > ...
12 years ago (2012-04-02 19:29:18 UTC) #3
Roger Tawa (Google)
One little typo :-) https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc File lib/rlz_lib_test.cc (right): https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc#newcode816 lib/rlz_lib_test.cc:816: // Se the comment at ...
12 years ago (2012-04-02 19:31:17 UTC) #4
shess
https://codereview.appspot.com/5966066/diff/4001/lib/rlz_lib_test.cc File lib/rlz_lib_test.cc (right): https://codereview.appspot.com/5966066/diff/4001/lib/rlz_lib_test.cc#newcode798 lib/rlz_lib_test.cc:798: chmod(temp_dir_.path().value().c_str(), 0400); On 2012/04/02 19:29:18, thakis wrote: > On ...
12 years ago (2012-04-02 19:34:50 UTC) #5
Mark Mentovai
LGTM https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc File lib/rlz_lib_test.cc (right): https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc#newcode798 lib/rlz_lib_test.cc:798: chmod(temp_dir_.path().value().c_str(), 0500); or 0100 if you don’t want ...
12 years ago (2012-04-02 19:38:44 UTC) #6
thakis
Thanks! https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc File lib/rlz_lib_test.cc (right): https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc#newcode798 lib/rlz_lib_test.cc:798: chmod(temp_dir_.path().value().c_str(), 0500); On 2012/04/02 19:38:44, Mark Mentovai wrote: ...
12 years ago (2012-04-02 19:45:39 UTC) #7
shess
https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc File lib/rlz_lib_test.cc (right): https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc#newcode798 lib/rlz_lib_test.cc:798: chmod(temp_dir_.path().value().c_str(), 0500); On 2012/04/02 19:38:44, Mark Mentovai wrote: > ...
12 years ago (2012-04-02 19:46:29 UTC) #8
thakis
12 years ago (2012-04-02 19:47:48 UTC) #9
https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc
File lib/rlz_lib_test.cc (right):

https://codereview.appspot.com/5966066/diff/1004/lib/rlz_lib_test.cc#newcode798
lib/rlz_lib_test.cc:798: chmod(temp_dir_.path().value().c_str(), 0500);
On 2012/04/02 19:46:29, shess wrote:
> On 2012/04/02 19:38:44, Mark Mentovai wrote:
> > or 0100 if you don’t want to allow the owner to enumerate, per Scott.
> 
> Err, before that offhand comment gets out of hand ... 0100 mostly just annoys
> the owner, because they can't recursively delete the damned thing, but they
can
> chmod it.  1 for group or other is semi-useful for readable dropboxes, but
> dollars to donuts is the wrong thing to do.

It's in a ScopedTempDir. But fine, changed it back to 0500 :-/
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b