[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-10-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15580109#comment-15580109
 ] 

ASF GitHub Bot commented on BOOKKEEPER-924:
---

Github user jvrao closed the pull request at:

https://github.com/apache/bookkeeper/pull/38


> 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: Enrico Olivelli
>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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-10-13 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15571862#comment-15571862
 ] 

Hudson commented on BOOKKEEPER-924:
---

FAILURE: Integrated in Jenkins build bookkeeper-master #1533 (See 
[https://builds.apache.org/job/bookkeeper-master/1533/])
BOOKKEEPER-924: addEntry() is susceptible to spurious wakeups (sijie: rev 
bf4a4d6a07f9d615752054c6743035cebd86716e)
* (edit) 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java
* (edit) 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java
* (edit) 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandleAdv.java
* (edit) 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
* (add) 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/SynchCallbackUtils.java


> 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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-10-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15571132#comment-15571132
 ] 

ASF GitHub Bot commented on BOOKKEEPER-924:
---

Github user sijie commented on the issue:

https://github.com/apache/bookkeeper/pull/38
  
@jvrao I merged @eolivelli 's pull request. mind closing this PR?


> 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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-10-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15571129#comment-15571129
 ] 

ASF GitHub Bot commented on BOOKKEEPER-924:
---

Github user asfgit closed the pull request at:

https://github.com/apache/bookkeeper/pull/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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-10-03 Thread Enrico Olivelli (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15542345#comment-15542345
 ] 

Enrico Olivelli commented on BOOKKEEPER-924:


I have submitted a PR with the switch to CompletableFuture.

I had to keep the SyncCounter class in order to make Compat test run

> 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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-10-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-09-29 Thread Enrico Olivelli (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15532052#comment-15532052
 ] 

Enrico Olivelli commented on BOOKKEEPER-924:


[~merlimat] [~jujjuri] I tried to replace SynchCounter with CompletableFuture 
and the change is quite easy.

Can I pick up this issue ?
For me is quite important as I have seen it in production

> 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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-09-28 Thread Venkateswararao Jujjuri (JV) (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15530101#comment-15530101
 ] 

Venkateswararao Jujjuri (JV) commented on BOOKKEEPER-924:
-

Assigned to [~merlimat] as he is interested in addressing this issue.

> 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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-08-25 Thread Sijie Guo (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15437607#comment-15437607
 ] 

Sijie Guo commented on BOOKKEEPER-924:
--

[~eolivelli] interesting. I do not see other explanations rather than spurious 
wakeup

> 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: Venkateswararao Jujjuri (JV)
>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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-08-25 Thread Enrico Olivelli (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15436958#comment-15436958
 ] 

Enrico Olivelli commented on BOOKKEEPER-924:


I think I have just seen this issue in production, a call to 
LedgerHandle#readEntries returned a null value

Is there any other explanation ?




> 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: Venkateswararao Jujjuri (JV)
>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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-08-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15423115#comment-15423115
 ] 

ASF GitHub Bot commented on BOOKKEEPER-924:
---

Github user sijie commented on the issue:

https://github.com/apache/bookkeeper/pull/38
  
@jvrao ping?


> 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: Venkateswararao Jujjuri (JV)
>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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-07-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15396762#comment-15396762
 ] 

ASF GitHub Bot commented on BOOKKEEPER-924:
---

Github user sijie commented on the issue:

https://github.com/apache/bookkeeper/pull/38
  
@jvrao it is java 8 now. do you want to update the pull request?


> 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: Venkateswararao Jujjuri (JV)
>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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-06-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15334846#comment-15334846
 ] 

ASF GitHub Bot commented on BOOKKEEPER-924:
---

Github user sijie commented on the issue:

https://github.com/apache/bookkeeper/pull/38
  
Lets first bump the JAVA version to JAVA 8 and then we update pull request 
the CompleteFuture.


> 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: Venkateswararao Jujjuri (JV)
>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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-04-24 Thread Venkateswararao Jujjuri (JV) (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15255725#comment-15255725
 ] 

Venkateswararao Jujjuri (JV) commented on BOOKKEEPER-924:
-

Are these flappers? BackwardCompat test passed multiple times on my box. 

> 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: Venkateswararao Jujjuri (JV)
>Priority: Critical
> Fix For: 4.4.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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-04-23 Thread Venkateswararao Jujjuri (JV) (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15255168#comment-15255168
 ] 

Venkateswararao Jujjuri (JV) commented on BOOKKEEPER-924:
-

Strange will look into it. Just this test failed???

> 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: Venkateswararao Jujjuri (JV)
>Priority: Critical
> Fix For: 4.4.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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-04-22 Thread Venkateswararao Jujjuri (JV) (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15254730#comment-15254730
 ] 

Venkateswararao Jujjuri (JV) commented on BOOKKEEPER-924:
-

[~si...@apache.org] [~merlimat] FYI.

> 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: Venkateswararao Jujjuri (JV)
>Priority: Critical
> Fix For: 4.4.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)


[jira] [Commented] (BOOKKEEPER-924) addEntry() is susceptible to spurious wakeups

2016-04-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15254712#comment-15254712
 ] 

ASF GitHub Bot commented on BOOKKEEPER-924:
---

GitHub user jvrao opened a pull request:

https://github.com/apache/bookkeeper/pull/38

BOOKKEEPER-924  Handle Spurious wakeups

SyncCounter doesn't handle Spurious wakeups.
Make use of CountDownLatch latch instead of native counter

Signed-off-by: Venkateswararao Jujjuri (JV) 

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jvrao/bookkeeper bk_924

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/bookkeeper/pull/38.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 #38


commit 74167b16aa9b2c87ee2c2001d5c6d5322036b6cd
Author: JV 
Date:   2016-04-22T18:00:22Z

BOOKKEEPER-924  Handle Spurious wakeups

SyncCounter doesn't handle Spurious wakeups.
Make use of CountDownLatch latch instead of native counter

Signed-off-by: Venkateswararao Jujjuri (JV) 




> addEntry() is susceptible to spurious wakeups
> -
>
> Key: BOOKKEEPER-924
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-924
> Project: Bookkeeper
>  Issue Type: Bug
>Reporter: Venkateswararao Jujjuri (JV)
>Assignee: Venkateswararao Jujjuri (JV)
>Priority: Critical
>
> 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)