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

Ivan Kelly commented on BOOKKEEPER-38:
--------------------------------------

I don't like the idea of Bookie getting a reference to to BookieServer. This 
creates a circular dependency. Off the top of my head, I think it would be 
better to have a deathwatcher thread running in BookieServer. 

{code}
class DeathWatcher extends Thread {
   public void run() {
      while (true) {
          Thread.sleep(1000);
          if (!nioServerFactory.isAlive() || !bookie.isAlive()) {
             shutdown();
             break;
          }
      }
   }
}
{code}

BookieServer#shutdown would need to be synchronized to avoid race problems 
here. Bookie#shutdown and NioServerFactory#shutdown also in fact. This 
shouldn't affect performance at all though, as they on run on shutdown by 
definition.

> Bookie Server doesn't exit when its zookeeper session is expired. So the 
> process is hang there.
> -----------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-38
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-38
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-server
>    Affects Versions: 3.4.0
>            Reporter: Sijie Guo
>             Fix For: 3.4.0
>
>         Attachments: BookieZKExpireTest.java, bookkeeper-38.patch, 
> bookkeeper-38_v2.patch
>
>
> Bookie server doesn't process zookeeper watcher events and just ignore them. 
> So when session expires, bookie server hangs there and can't do nothing.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to