Bookkeeper
  1. Bookkeeper
  2. BOOKKEEPER-216

Bookie doesn't exit with right exit code

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1.0
    • Fix Version/s: 4.1.0
    • Component/s: None
    • Labels:
      None

      Description

      there is typo in Bookie#shutdown. so it doesn't quit with right exit code when encountering exceptions.

          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;
          }
      
      1. BK-216.diff
        0.6 kB
        Sijie Guo

        Activity

        Hide
        Sijie Guo added a comment -

        attach a patch to fix this issue. should return this.exitCode instead of exitCode.

        Show
        Sijie Guo added a comment - attach a patch to fix this issue. should return this.exitCode instead of exitCode.
        Hide
        Ivan Kelly added a comment -

        lgtm +1

        Show
        Ivan Kelly added a comment - lgtm +1
        Hide
        Ivan Kelly added a comment -

        Committed as r1326624, thanks Sijie.

        Show
        Ivan Kelly added a comment - Committed as r1326624, thanks Sijie.
        Hide
        Hudson added a comment -

        Integrated in bookkeeper-trunk #461 (See https://builds.apache.org/job/bookkeeper-trunk/461/)
        BOOKKEEPER-216: Bookie doesn't exit with right exit code (sijie via ivank) (Revision 1326624)

        Result = SUCCESS
        ivank :
        Files :

        • /zookeeper/bookkeeper/trunk/CHANGES.txt
        • /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
        Show
        Hudson added a comment - Integrated in bookkeeper-trunk #461 (See https://builds.apache.org/job/bookkeeper-trunk/461/ ) BOOKKEEPER-216 : Bookie doesn't exit with right exit code (sijie via ivank) (Revision 1326624) Result = SUCCESS ivank : Files : /zookeeper/bookkeeper/trunk/CHANGES.txt /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java

          People

          • Assignee:
            Sijie Guo
            Reporter:
            Sijie Guo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development