You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/21 10:48:01 UTC

[GitHub] [pulsar] lhotari opened a new pull request #10304: [Broker] Fix logging in shutdown and improve it

lhotari opened a new pull request #10304:
URL: https://github.com/apache/pulsar/pull/10304


   ### Motivation
   
   By default Log4J2 registers a shutdown hook which stops Log4J2 logging before the broker shutdown has completed. This makes it hard to diagnose issues in broker shutdown.
   There's an issue #10289 reported about problems in broker shutdown. This PR will also help to diagnose that issue.
   
   ### Modifications
   
   - add more logging to shutdown
   - pass `-Dlog4j.shutdownHookEnabled=false` option to broker and standalone startup
   - initiate Log4J2 shutdown manually by calling `LogManager.shutdown()` before the JVM exits
   - remove outdated code to flush Logback logger before shutdown
   - print the stacktraces for uncaught exceptions in the broker


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] lhotari commented on pull request #10304: [Broker] Fix logging in shutdown and improve it

Posted by GitBox <gi...@apache.org>.
lhotari commented on pull request #10304:
URL: https://github.com/apache/pulsar/pull/10304#issuecomment-824233909


   /pulsarbot run-failure-checks


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] merlimat merged pull request #10304: [Broker] Fix logging in shutdown and improve it

Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #10304:
URL: https://github.com/apache/pulsar/pull/10304


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] lhotari commented on a change in pull request #10304: [Broker] Fix logging in shutdown and improve it

Posted by GitBox <gi...@apache.org>.
lhotari commented on a change in pull request #10304:
URL: https://github.com/apache/pulsar/pull/10304#discussion_r617687341



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -337,6 +337,7 @@ public void close() throws PulsarServerException {
             if (closeFuture != null) {
                 return closeFuture;
             }
+            LOG.info("Closing");

Review comment:
       Applied. Thanks!




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] merlimat commented on a change in pull request #10304: [Broker] Fix logging in shutdown and improve it

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #10304:
URL: https://github.com/apache/pulsar/pull/10304#discussion_r617680396



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -337,6 +337,7 @@ public void close() throws PulsarServerException {
             if (closeFuture != null) {
                 return closeFuture;
             }
+            LOG.info("Closing");

Review comment:
       We could use more explicit indication of what we're closing (and the other logs here). I know the logger name will contain the class name, but just to make it more clear and upfront.
   
   ```suggestion
               LOG.info("Closing PulsarService");
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org