[fix]Limiter class bug in env_posix #946#963
Closed
duststarr wants to merge 1 commit into
Closed
Conversation
Contributor
|
There is no way to safely allow redundant releases, since the new release
may be non-redundant and the redundant pair of acquires may have happened
earlier. E.g.,
thread 1:
acquire
release
release (redundant)
thread 2:
acquire
release
The redundant release in thread 1 already broke things for thread 2 by
cancelling its acquire early.
As you mentioned in the previous discussion, this is a local class, and
there is a clear responsibility for the owner to match up acquire and
releases. So let's stick with the old code.
…On Wed, Dec 15, 2021 at 1:16 AM duststarr ***@***.***> wrote:
As the issue #946 <#946> .
Add a check for max_acquires when Release() called to ignore redundant
calls.
------------------------------
You can view, comment on, or merge this pull request online at:
#963
Commit Summary
- 8f460db
<8f460db>
Ignore redundant calls of Release().
File Changes
(2 files <https://github.com/google/leveldb/pull/963/files>)
- *M* util/env_posix.cc
<https://github.com/google/leveldb/pull/963/files#diff-6e3e34528a780e660b519271c86d81c55519dcaf2fb7965fd0b232ae5cdcf0c5>
(14)
- *M* util/env_windows.cc
<https://github.com/google/leveldb/pull/963/files#diff-2b583b3bf3d6e9b3cf1d894934eaf3e6048f89e34e1e15e8343aa2bf753e6048>
(15)
Patch Links:
- https://github.com/google/leveldb/pull/963.patch
- https://github.com/google/leveldb/pull/963.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#963>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5YZULMKSQ4ZNQRSFEB62DURBMFXANCNFSM5KDC22ZQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
|
good |
Member
|
We could do something like pwnall@0bc209d to make it obvious that calling Limiter::Release() too many times is a bug in the Limiter client. |
Member
|
Landed the above in 335876a |
Author
|
Good solution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As the issue #946 .
Add a check for max_acquires when Release() called to ignore redundant calls.