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

Han Xiao commented on BOOKKEEPER-525:
-------------------------------------

Hi. As in BK-408, testcase is blocked by the following code:
{code:java} 
            // wait for all entries to be acknowledged
            synchronized (sync) {
                while (sync.counter < numEntriesToWrite) {
                    LOG.debug("Entries counter = " + sync.counter);
                    sync.wait();
                }
            }
{code} 
the sync.counter is increased by the following code:
{code:java}
    public void addComplete(int rc, LedgerHandle lh, long entryId, Object ctx) {
        if(rc != BKException.Code.OK) fail("Return code is not OK: " + rc);

        SyncObj x = (SyncObj) ctx;

        synchronized \(x) {
            x.counter++;
            x.notify();
        }
    }
{code}
if rc is not equal to BK.Code.OK, fail() will be executed. However, because 
addComplete() is called in callback, the fail() will not ending the test 
process as expected. Then the x.counter will not be increased, and test process 
block in sync.wait() forever for the condition of 'sync.counter < 
numEntriesToWrite' won't be satisfied.

                
> Should not using Junit Assert in CallBack method in BK test.
> ------------------------------------------------------------
>
>                 Key: BOOKKEEPER-525
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-525
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Han Xiao
>
> There are many jiras to solve the problem of running forever of bk test.
> Many of them are coming from the using 'Junit Assert' in callback. The using 
> must be revised through the entire test project. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to