You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/09/27 06:54:23 UTC

[GitHub] [rocketmq] aaron-ai commented on a diff in pull request #5194: Add preShutdown for grace shutdown

aaron-ai commented on code in PR #5194:
URL: https://github.com/apache/rocketmq/pull/5194#discussion_r980827974


##########
proxy/src/main/java/org/apache/rocketmq/proxy/config/ProxyConfig.java:
##########
@@ -161,6 +161,8 @@ public class ProxyConfig implements ConfigFile {
     // Example address: 127.0.0.1:1234
     private String metricCollectorAddress = "";
 
+    private long graceShutdownTimeMillis = Duration.ofSeconds(5).toMillis();

Review Comment:
   ```suggestion
       private long gracefullyShutdownTimeMillis = Duration.ofSeconds(5).toMillis();
   ```



##########
proxy/src/main/java/org/apache/rocketmq/proxy/ProxyStartup.java:
##########
@@ -93,6 +93,8 @@ public static void main(String[] args) {
             Runtime.getRuntime().addShutdownHook(new Thread(() -> {
                 log.info("try to shutdown server");
                 try {
+                    PROXY_START_AND_SHUTDOWN.preShutdown();
+                    Thread.sleep(ConfigurationManager.getProxyConfig().getGraceShutdownTimeMillis());

Review Comment:
   How the `graceShutdownTimeMillis` is determined?



-- 
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: dev-unsubscribe@rocketmq.apache.org

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