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/07/20 05:38:23 UTC

[GitHub] [ozone] sky76093016 opened a new pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

sky76093016 opened a new pull request #2440:
URL: https://github.com/apache/ozone/pull/2440


   ## What changes were proposed in this pull request?
   
   As described in [HDDS-5434](https://github.com/apache/ozone/pull/2413).
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/projects/HDDS/issues/HDDS-5467
   
   ## How was this patch tested?
   
   No need.
   


-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] sky76093016 commented on a change in pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
sky76093016 commented on a change in pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#discussion_r672932229



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -35,11 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;

Review comment:
       Sorry I didn't notice it.I will fix it.




-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] jojochuang commented on pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
jojochuang commented on pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#issuecomment-883229356


   Will merge after precommit passes.


-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] jojochuang commented on pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
jojochuang commented on pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#issuecomment-883229356


   Will merge after precommit passes.


-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] jojochuang commented on a change in pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
jojochuang commented on a change in pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#discussion_r672888678



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -134,9 +130,12 @@ int executeShutdown() {
         future.cancel(true);
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' timeout, " + ex.toString(), ex);
-      } catch (Throwable ex) {
+      } catch (InterruptedException ex) {
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' failed, " + ex.toString(), ex);
+        Thread.currentThread().interrupt();
+      } catch (ExecutionException ex) {
+        ex.printStackTrace();

Review comment:
       please use LOG to record the exception.

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -35,11 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;

Review comment:
       I'm sorry forgot this one: can you not use wilcard import? Meaning: explicitly list each of the classes imported.




-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] jojochuang commented on a change in pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
jojochuang commented on a change in pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#discussion_r672888678



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -134,9 +130,12 @@ int executeShutdown() {
         future.cancel(true);
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' timeout, " + ex.toString(), ex);
-      } catch (Throwable ex) {
+      } catch (InterruptedException ex) {
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' failed, " + ex.toString(), ex);
+        Thread.currentThread().interrupt();
+      } catch (ExecutionException ex) {
+        ex.printStackTrace();

Review comment:
       please use LOG to record the exception.

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -35,11 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;

Review comment:
       I'm sorry forgot this one: can you not use wilcard import? Meaning: explicitly list each of the classes imported.




-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] jojochuang commented on a change in pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
jojochuang commented on a change in pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#discussion_r672928346



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -35,11 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;

Review comment:
       I'm sorry forgot this one: can you not use wilcard import? Meaning: explicitly list each of the classes imported.




-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] jojochuang commented on pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
jojochuang commented on pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#issuecomment-883229356


   Will merge after precommit passes.


-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] sky76093016 commented on a change in pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
sky76093016 commented on a change in pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#discussion_r672892029



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -134,9 +130,12 @@ int executeShutdown() {
         future.cancel(true);
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' timeout, " + ex.toString(), ex);
-      } catch (Throwable ex) {
+      } catch (InterruptedException ex) {
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' failed, " + ex.toString(), ex);
+        Thread.currentThread().interrupt();
+      } catch (ExecutionException ex) {
+        ex.printStackTrace();

Review comment:
       Of course, I immediately modify it.

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -35,11 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;

Review comment:
       I will fix it.

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -35,11 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;

Review comment:
       Sorry I didn't notice it.I will fix it.




-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] sky76093016 commented on a change in pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
sky76093016 commented on a change in pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#discussion_r672932229



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -35,11 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;

Review comment:
       I will fix it.




-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] jojochuang commented on a change in pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
jojochuang commented on a change in pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#discussion_r672888678



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -134,9 +130,12 @@ int executeShutdown() {
         future.cancel(true);
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' timeout, " + ex.toString(), ex);
-      } catch (Throwable ex) {
+      } catch (InterruptedException ex) {
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' failed, " + ex.toString(), ex);
+        Thread.currentThread().interrupt();
+      } catch (ExecutionException ex) {
+        ex.printStackTrace();

Review comment:
       please use LOG to record the exception.




-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] sky76093016 commented on a change in pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
sky76093016 commented on a change in pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#discussion_r672892029



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -134,9 +130,12 @@ int executeShutdown() {
         future.cancel(true);
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' timeout, " + ex.toString(), ex);
-      } catch (Throwable ex) {
+      } catch (InterruptedException ex) {
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' failed, " + ex.toString(), ex);
+        Thread.currentThread().interrupt();
+      } catch (ExecutionException ex) {
+        ex.printStackTrace();

Review comment:
       Of course, I immediately modify it.




-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] jojochuang merged pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
jojochuang merged pull request #2440:
URL: https://github.com/apache/ozone/pull/2440


   


-- 
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: issues-unsubscribe@ozone.apache.org

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


[GitHub] [ozone] sky76093016 commented on a change in pull request #2440: HDDS-5467. Handle potential InterruptedException in Ozone

Posted by GitBox <gi...@apache.org>.
sky76093016 commented on a change in pull request #2440:
URL: https://github.com/apache/ozone/pull/2440#discussion_r672892029



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -134,9 +130,12 @@ int executeShutdown() {
         future.cancel(true);
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' timeout, " + ex.toString(), ex);
-      } catch (Throwable ex) {
+      } catch (InterruptedException ex) {
         LOG.warn("ShutdownHook '" + entry.getHook().getClass().
             getSimpleName() + "' failed, " + ex.toString(), ex);
+        Thread.currentThread().interrupt();
+      } catch (ExecutionException ex) {
+        ex.printStackTrace();

Review comment:
       Of course, I immediately modify it.

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -35,11 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;

Review comment:
       I will fix it.

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/util/ShutdownHookManager.java
##########
@@ -35,11 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;

Review comment:
       Sorry I didn't notice it.I will fix it.




-- 
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: issues-unsubscribe@ozone.apache.org

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