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 2022/07/23 11:28:07 UTC

[GitHub] [pulsar] HQebupt opened a new pull request, #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

HQebupt opened a new pull request, #16756:
URL: https://github.com/apache/pulsar/pull/16756

   Fixed #16755 
   
   ### Motivation
   see #16755 
   
   ### Modifications
   - close protocol handler before closing broker server. Because the protocol handler service maybe depends on broker service.
   - First close the `acceptorGroup` and `workerGroup` service of `BrokerService`. Because they can accept the request from outside.
   
   ### Verifying this change
   
   - [x]  Make sure that the change passes the CI checks.
   
   This change is a trivial rework / code cleanup without any test coverage.
   ### Does this pull request potentially affect one of the following parts:
   
   If `yes` was chosen, please highlight the changes
   
   - Dependencies (does it add or upgrade a dependency): (no)
   - The public API: (no)
   - The schema: (no)
   - The default values of configurations: (no)
   - The wire protocol: (no)
   - The rest endpoints: (no)
   - The admin cli options: (no)
   - Anything that affects deployment: (no)
   
   ### Documentation
   Check the box below and label this PR (if you have committer privilege).
   
   Need to update docs? 
   - [x] `doc-not-needed` 
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1217792742

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] Jason918 commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
Jason918 commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1214550091

   > If the EventLoop is closed first, the client reconnection will fail.
   The reconnection won't retry to other brokers?
   
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] codelipenghui merged pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
codelipenghui merged PR #16756:
URL: https://github.com/apache/pulsar/pull/16756


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1193470703

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1214582681

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1217395702

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] Technoboy- commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1216399597

   > > If the EventLoop is closed first, the client reconnection will fail.
   > 
   > The reconnection won't retry to other brokers? @Technoboy-
   
   Bundle is not unloaded at the moment.  


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1218883391

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on a diff in pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on code in PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#discussion_r946890686


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -731,6 +731,13 @@ public CompletableFuture<Void> closeAndRemoveReplicationClient(String clusterNam
     public CompletableFuture<Void> closeAsync() {
         try {
             log.info("Shutting down Pulsar Broker service");
+            log.info("Event loops shutting down gracefully...");
+            List<CompletableFuture<?>> shutdownEventLoops = new ArrayList<>();
+            shutdownEventLoops.add(shutdownEventLoopGracefully(acceptorGroup));
+            shutdownEventLoops.add(shutdownEventLoopGracefully(workerGroup));

Review Comment:
   True. Closing protocol handler first is reasonable because the protocol handler service maybe depends on broker service. How about it ? @Technoboy- 
   <img width="959" alt="image" src="https://user-images.githubusercontent.com/4970972/184911740-760e9eb3-563c-4732-9dcd-11eaccc4b996.png">
   



-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1217823312

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1193240305

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1193316532

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1217374906

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1218281632

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1214546054

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1193261587

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1214800777

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1216761089

   > > > If the EventLoop is closed first, the client reconnection will fail.
   > > 
   > > 
   > > The reconnection won't retry to other brokers? @Technoboy-
   > 
   > Bundle is not unloaded at the moment.
   
   True. Closing protocol handler first is reasonable because the outside service maybe depends on broker service. How about it ? @Technoboy- @poorbarcode 


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] poorbarcode commented on a diff in pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
poorbarcode commented on code in PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#discussion_r946722398


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -731,6 +731,13 @@ public CompletableFuture<Void> closeAndRemoveReplicationClient(String clusterNam
     public CompletableFuture<Void> closeAsync() {
         try {
             log.info("Shutting down Pulsar Broker service");
+            log.info("Event loops shutting down gracefully...");
+            List<CompletableFuture<?>> shutdownEventLoops = new ArrayList<>();
+            shutdownEventLoops.add(shutdownEventLoopGracefully(acceptorGroup));
+            shutdownEventLoops.add(shutdownEventLoopGracefully(workerGroup));

Review Comment:
   Other close tasks rely on EventLoop. E.g. `unloadNamespaceBundlesGracefully`, I don't recommend this change.



-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1214649018

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1216105996

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1217501280

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] HQebupt commented on pull request #16756: [fix][broker]optimize the shutdown sequence of broker service when it close

Posted by GitBox <gi...@apache.org>.
HQebupt commented on PR #16756:
URL: https://github.com/apache/pulsar/pull/16756#issuecomment-1220216916

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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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