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

Sijie Guo commented on BOOKKEEPER-689:
--------------------------------------

I don't think this is an issue in bookkeeper client.

[ pool size = 0, active threads = 0, queued tasks = 1, completed tasks = 0 ]. 
pool size & active threads are 0 means there is no worker thread in the 
executor. and completed tasks is 0 means there is no tasks is executed. it 
looks like a race condition in add & shutdown of executor, so the task is 
queued and but no work thread to execute.

since bookkeeper#close takes up to 10 seconds, the bookkeeper test should wait 
more than 10 seconds until bookkeeper#close finished.

{code}
    public String toString() {
        long ncompleted;
        int nworkers, nactive;
        final ReentrantLock mainLock = this.mainLock;
        mainLock.lock();
        try {
            ncompleted = completedTaskCount;
            nactive = 0;
            nworkers = workers.size();
            for (Worker w : workers) {
                ncompleted += w.completedTasks;
                if (w.isLocked())
                    ++nactive;
            }
        } finally {
            mainLock.unlock();
        }
        int c = ctl.get();
        String rs = (runStateLessThan(c, SHUTDOWN) ? "Running" :
                     (runStateAtLeast(c, TERMINATED) ? "Terminated" :
                      "Shutting down"));
        return super.toString() +
            "[" + rs +
            ", pool size = " + nworkers +
            ", active threads = " + nactive +
            ", queued tasks = " + workQueue.size() +
            ", completed tasks = " + ncompleted +
            "]";
    }
{code}

> BookKeeperTest failure
> ----------------------
>
>                 Key: BOOKKEEPER-689
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-689
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Flavio Junqueira
>         Attachments: org.apache.bookkeeper.client.BookKeeperTest-output.txt, 
> TEST-org.apache.bookkeeper.client.BookKeeperTest.xml
>
>
> Tests run: 12, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 49.385 sec 
> <<< FAILURE!
> testCloseDuringOp[1](org.apache.bookkeeper.client.BookKeeperTest)  Time 
> elapsed: 14.74 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: Close never completed
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.assertTrue(Assert.java:20)
>         at 
> org.apache.bookkeeper.client.BookKeeperTest.testCloseDuringOp(BookKeeperTest.java:217)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>         at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>         at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>         at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>         at 
> org.junit.internal.runners.statements.FailOnTimeout$1.run(FailOnTimeout.java:28)



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to