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

Rakesh R commented on BOOKKEEPER-326:
-------------------------------------

@Ivan
bq.I don't think the problem here is that callbacks are running in the same 
thread

ChannelFuture javadoc says that if the connection has already established 
before adding the listener, it will be notified immediately.
{code}
    /**
     * Adds the specified listener to this future.  The
     * specified listener is notified when this future is
     * {@linkplain #isDone() done}.  If this future is already
     * completed, the specified listener is notified immediately.
     */
    void addListener(ChannelFutureListener listener);
{code}

Also, I've seen netty is creating 'DefaultChannelFuture' instance and the 
addListener() method invokes operationComplete() call in the same thread.
{code}
    public void addListener(ChannelFutureListener listener) {
        if (listener == null) {
            throw new NullPointerException("listener");
        }

        boolean notifyNow = false;
        synchronized (this) {
            if (done) {
                notifyNow = true;
            } else {
                //.......
            }
        }

        if (notifyNow) {
            notifyListener(listener);
        }
    }
{code}


We will be able to see this by just hold(debug point) the 
'future.addListener()' invocation for few ms/secs. After connection 
establishment if we execute future.addListener will notifies the 
operationComplete() in the same thread. 
                
> DeadLock during ledger recovery 
> --------------------------------
>
>                 Key: BOOKKEEPER-326
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-326
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Vinay
>            Priority: Blocker
>         Attachments: BK_DeadLock.log, BOOKKEEPER-326.patch
>
>
> Deadlock found during ledger recovery. please find the attached thread dump.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to