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

Hudson commented on BOOKKEEPER-957:
-----------------------------------

SUCCESS: Integrated in Jenkins build bookkeeper-master #1560 (See 
[https://builds.apache.org/job/bookkeeper-master/1560/])
BOOKKEEPER-957: LedgerHandleAdv fixes (sijie: rev 
8f0bed9f8401001abd683c420757610996cf96d8)
* (edit) 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandleAdv.java


> issues in LedgerHandleAdv 
> --------------------------
>
>                 Key: BOOKKEEPER-957
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-957
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Charan Reddy Guttapalem
>            Assignee: Charan Reddy Guttapalem
>
> 1)  In LedgerHandleAdv in doAsyncAddEntry method, addToLength(length) call is 
> not synchronized
> In LedgerHandleAdv in doAsyncAddEntry method, call to addToLength(length) is 
> not synchronized.
> addEntry method is supposed to be thread safe, so when addEntry method of 
> LedgerHandleAdv is called concurrently from multiple threads, addToLength 
> will be messed up because its call is not synchrnoized.
> in LedgerHandle it is synchronized over 'this'.
> 2) In LedgerHandleAdv, in asyncAddEntry it is incorrect to add 'op' to 
> 'pendingAddOps' before calling doAsyncAddEntry
>  In LedgerHandleAdv, in asyncAddEntry, it is incorrect to add 'op' to 
> 'pendingAddOps' before calling doAsyncAddEntry.
> Consider the following example,
> Lets say "asyncAddEntry(final long entryId, final byte[] data, final int 
> offset, final int length, final AddCallback cb, final Object ctx)" is called 
> with incorrect arguments, and following condition is failed "(offset < 0 || 
> length < 0 || (offset + length) > data.length)". Then as expected we would 
> get ArrayIndexOutOfBoundsException, but now if we try to call asyncAddEntry 
> with correct arguments for that entry, then it will fail with 
> "DuplicateEntryIdException", since the op is added already in the previous 
> call, which shouldn't have happened.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to