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

Sijie Guo edited comment on BOOKKEEPER-610 at 5/15/13 1:38 AM:
---------------------------------------------------------------

{code}
When a fatal exception occurs, the bookie calls shutdown on the sync thread, 
which calls shutdown on the executor. This stops any new checkpoint tasks being 
scheduled.
{code}

this would be a deadlock when shutting down, a executor task is running to 
shutdown bookie and the shutdown process needs to shutdown executor itself, 
which needs to wait until task is finished. There was a bug before related to 
this issue.

in original implementation, it is easy to figure out what happened when you got 
the stacktrace, even it used boolean flag, since the stacktrace would show 
different branches of the code that it executed. it is not bad as you said.

I don't feel strongly about this part. If the comment could be addressed and 
other people has +1 on it, I am OK with that.
                
      was (Author: hustlmsp):
    {code}
When a fatal exception occurs, the bookie calls shutdown on the sync thread, 
which calls shutdown on the executor. This stops any new checkpoint tasks being 
scheduled.
{code}

this would be a deadlock when shutting down, a executor task is running to 
shutdown bookie and the shutdown process needs to shutdown executor itself, 
which needs to wait until task is finished. There was a bug before related to 
this issue.

in original implementation, it is easy to figure out what happened when you got 
the stacktrace, even it used boolean flag, but the stacktrace would showed 
different line of the code that it executed. when using executor, it is hard to 
figure out what happened.

I don't feel strongly about this part. If the comment could be addressed and 
other people has +1 on it, I am OK with that.
                  
> Make SyncThread use an executor
> -------------------------------
>
>                 Key: BOOKKEEPER-610
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-610
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Ivan Kelly
>            Assignee: Ivan Kelly
>             Fix For: 4.3.0
>
>         Attachments: 
> 0001-BOOKKEEPER-610-Make-SyncThread-use-an-executor.patch, 
> 0001-BOOKKEEPER-610-Make-SyncThread-use-an-executor.patch, 
> 0001-BOOKKEEPER-610-Make-SyncThread-use-an-executor.patch
>
>
> Currently we have a bunch of boolean variables to control the lifecycle of 
> the SyncThread. We're effectively replicating what an Executor does, so we 
> should just use an executor.

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