You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/06/03 04:26:16 UTC

[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2299: HDDS-5290. Handle SIGTERM to ensure clean shutdown of SCM.

bharatviswa504 commented on a change in pull request #2299:
URL: https://github.com/apache/ozone/pull/2299#discussion_r644474492



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManagerStarter.java
##########
@@ -164,7 +166,15 @@ private void commonInit() {
     public void start(OzoneConfiguration conf) throws Exception {
       StorageContainerManager stm = StorageContainerManager.createSCM(conf);
       stm.start();
-      stm.join();
+
+      ShutdownHookManager.get().addShutdownHook(() -> {

Review comment:
       I see the default is 30 seconds.
   
   ```
     /** Default shutdown hook timeout: {@value} seconds. */
     public static final long SERVICE_SHUTDOWN_TIMEOUT_DEFAULT = 30;
   
     static long getShutdownTimeout(Configuration conf) {
       long duration = conf.getTimeDuration(
           SERVICE_SHUTDOWN_TIMEOUT,
           SERVICE_SHUTDOWN_TIMEOUT_DEFAULT,
           TIME_UNIT_DEFAULT);
       if (duration < TIMEOUT_MINIMUM) {
         duration = TIMEOUT_MINIMUM;
       }
       return duration;
     }
   ```




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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org