You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/09/15 03:37:12 UTC

[GitHub] [hadoop] Hexiaoqiao commented on a change in pull request #2259: HADOOP-17208. LoadBalanceKMSClientProvider#deleteKey should invalidat…

Hexiaoqiao commented on a change in pull request #2259:
URL: https://github.com/apache/hadoop/pull/2259#discussion_r488362922



##########
File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/ValueQueue.java
##########
@@ -299,19 +299,18 @@ public E getNext(String keyName)
    * @param keyName the key to drain the Queue for
    */
   public void drain(String keyName) {
+    Runnable e;
+    while ((e = queue.deleteByName(keyName)) != null) {
+      executor.remove(e);
+    }
+    writeLock(keyName);
     try {
-      Runnable e;
-      while ((e = queue.deleteByName(keyName)) != null) {
-        executor.remove(e);
-      }
-      writeLock(keyName);
-      try {
-        keyQueues.get(keyName).clear();
-      } finally {
-        writeUnlock(keyName);
+      LinkedBlockingQueue kq = keyQueues.getIfPresent(keyName);
+      if (kq != null) {
+        kq.clear();
       }
-    } catch (ExecutionException ex) {

Review comment:
       Hi @xiaoyuyao , Not sure if it is compatible to throw out this exception. Other are fair enough to me. Thanks.




----------------------------------------------------------------
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: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org