You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Ivan Kelly (Commented) (JIRA)" <ji...@apache.org> on 2012/04/16 16:10:19 UTC

[jira] [Commented] (BOOKKEEPER-216) Bookie doesn't exit with right exit code

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

Ivan Kelly commented on BOOKKEEPER-216:
---------------------------------------

lgtm +1 
                
> Bookie doesn't exit with right exit code
> ----------------------------------------
>
>                 Key: BOOKKEEPER-216
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-216
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: BK-216.diff
>
>
> there is typo in Bookie#shutdown. so it doesn't quit with right exit code when encountering exceptions.
> {code}
>     synchronized int shutdown(int exitCode) {
>         try {
>             if (running) { // avoid shutdown twice
>                 // the exitCode only set when first shutdown usually due to exception found
>                 this.exitCode = exitCode;
>                 // mark bookie as in shutting down progress
>                 shuttingdown = true;
>                 // shut down gc thread, which depends on zookeeper client
>                 // also compaction will write entries again to entry log file
>                 gcThread.shutdown();
>                 // Shutdown the ZK client
>                 if(zk != null) zk.close();
>                 this.interrupt();
>                 this.join();
>                 syncThread.shutdown();
>                 // Shutdown the EntryLogger which has the GarbageCollector Thread running
>                 entryLogger.shutdown();
>                 // close Ledger Manager
>                 ledgerManager.close();
>                 // setting running to false here, so watch thread in bookie server know it only after bookie shut down
>                 running = false;
>             }    
>         } catch (InterruptedException ie) {
>             LOG.error("Interrupted during shutting down bookie : ", ie); 
>         }    
>         return exitCode;
>     }
> {code}

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