equanz opened a new pull request, #3663:
URL: https://github.com/apache/bookkeeper/pull/3663

   ### Motivation
   
   When I run `bookkeeper shell listledgers` command and get exception like the 
below, the shell process doesn't exit forever. I expect shell processes will 
exit soon.
   
   ```
   ...
   06:00:02.801 [main-EventThread] ERROR o.a.b.t.c.c.b.ListLedgersCommand     - 
Unable to read the ledger: 15256124 information
   06:00:02.805 [main-EventThread] ERROR o.a.b.p.BookkeeperInternalCallbacks  - 
Error in multi callback : -25
   06:00:02.807 [main] ERROR o.a.b.t.c.c.b.ListLedgersCommand     - Received 
error return value while processing ledgers: -1
   06:00:02.810 [main] ERROR o.a.b.t.c.c.b.ListLedgersCommand     - Received 
Exception while processing ledgers
   org.apache.bookkeeper.client.BKException$BKReadException: Error while 
reading ledger
           at 
org.apache.bookkeeper.client.BKException.create(BKException.java:62)
           at 
org.apache.bookkeeper.tools.cli.commands.bookie.ListLedgersCommand.lambda$handler$3(ListLedgersCommand.java:176)
           at 
org.apache.bookkeeper.meta.MetadataDrivers.lambda$runFunctionWithLedgerManagerFactory$2(MetadataDrivers.java:389)
           at 
org.apache.bookkeeper.meta.MetadataDrivers.runFunctionWithMetadataBookieDriver(MetadataDrivers.java:347)
           at 
org.apache.bookkeeper.meta.MetadataDrivers.runFunctionWithLedgerManagerFactory(MetadataDrivers.java:387)
           at 
org.apache.bookkeeper.tools.cli.commands.bookie.ListLedgersCommand.handler(ListLedgersCommand.java:127)
           at 
org.apache.bookkeeper.tools.cli.commands.bookie.ListLedgersCommand.apply(ListLedgersCommand.java:99)
           at 
org.apache.bookkeeper.bookie.BookieShell$ListLedgersCmd.runCmd(BookieShell.java:704)
           at 
org.apache.bookkeeper.bookie.BookieShell$MyCommand.runCmd(BookieShell.java:236)
           at 
org.apache.bookkeeper.bookie.BookieShell.run(BookieShell.java:2235)
           at 
org.apache.bookkeeper.bookie.BookieShell.main(BookieShell.java:2326)
   ...
   ```
   
   I encountered the issue in the v4.12.0 client.
   
   ### Changes
   
   * Close legacyLM and longLM if call HierarchicalLedgerManager#close
     - legacyLM and longLM have [inner 
scheduler](https://github.com/apache/bookkeeper/blob/e4ef0ef7f4f989e46f854c92ac7684325f050a60/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java#L87).
 In this case, these schedulers are not shut down.
   * Exit as ok when calling listledgers command and get 
NoSuchLedgerExistsOnMetadataServerException
   * Call `System.exit` even if get some exception in bookkeeler shell


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to