You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/10/03 12:43:20 UTC
[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to
spurious wakeups
[ https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15542341#comment-15542341 ]
ASF GitHub Bot commented on BOOKKEEPER-924:
-------------------------------------------
GitHub user eolivelli opened a pull request:
https://github.com/apache/bookkeeper/pull/60
BOOKKEEPER-924 addEntry() is susceptible to spurious wakeups
Use Java8 CompletableFuture instead of SyncCounter
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/eolivelli/bookkeeper BOOKKEEPER-924
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/bookkeeper/pull/60.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #60
----
----
> addEntry() is susceptible to spurious wakeups
> ---------------------------------------------
>
> Key: BOOKKEEPER-924
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-924
> Project: Bookkeeper
> Issue Type: Bug
> Affects Versions: 4.3.2
> Reporter: Venkateswararao Jujjuri (JV)
> Assignee: Matteo Merli
> Priority: Critical
> Fix For: 4.5.0
>
>
> LedgerHandle sync interface heavily depends on SyncCounter to convert async interfaces
> into sync interfaces.
> Usaylly
> SyncCounter.inc()
> asyncCall()
> SyncCOunter.block(0)
> The block code is.
> synchronized void block(int limit) throws InterruptedException {
> while (i > limit) {
> int prev = i;
> wait();
> if (i == prev) {
> break;
> }
> }
> }
> Since 'i' is going to be same as 'prev' on spurious wakeup, and wait() can return on spurious wakeups.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)