You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/05/14 12:59:48 UTC

[GitHub] [hbase] virajjasani commented on a change in pull request #3264: HBASE-25887 Wait for appendExecutor to shutdown running tasks

virajjasani commented on a change in pull request #3264:
URL: https://github.com/apache/hbase/pull/3264#discussion_r632509358



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
##########
@@ -1120,8 +1120,18 @@ public void shutdown() throws IOException {
           this.disruptor.shutdown();
         }
       }
-      // With disruptor down, this is safe to let go.
-      if (this.appendExecutor !=  null) this.appendExecutor.shutdown();
+
+      try {
+        // With disruptor down, this is safe to let go.
+        if (this.appendExecutor != null) {
+          this.appendExecutor.shutdown();
+          // Wait for 60 seconds to complete currently running tasks.
+          this.appendExecutor.awaitTermination(60, TimeUnit.SECONDS);

Review comment:
       Although 60s looks reasonable, want to make it configurable? I know another config is pain, but if the time comes, we can tweak it?

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
##########
@@ -1120,8 +1120,18 @@ public void shutdown() throws IOException {
           this.disruptor.shutdown();
         }
       }
-      // With disruptor down, this is safe to let go.
-      if (this.appendExecutor !=  null) this.appendExecutor.shutdown();
+
+      try {
+        // With disruptor down, this is safe to let go.
+        if (this.appendExecutor != null) {
+          this.appendExecutor.shutdown();
+          // Wait for 60 seconds to complete currently running tasks.
+          this.appendExecutor.awaitTermination(60, TimeUnit.SECONDS);
+        }
+      } catch (InterruptedException e) {
+        LOG.warn("Exception while waiting to shutdown executor ", e);

Review comment:
       Wondering if we should sleep for 5-10s by default here.




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