You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by ar...@apache.org on 2019/10/22 02:41:03 UTC

[hadoop-ozone] branch master updated: HDDS-2330. Random key generator can get stuck (#53)

This is an automated email from the ASF dual-hosted git repository.

arp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new eb1d77e  HDDS-2330. Random key generator can get stuck (#53)
eb1d77e is described below

commit eb1d77e3206fab1a4ac0573507c9deb2b56b9ea1
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Tue Oct 22 04:40:58 2019 +0200

    HDDS-2330. Random key generator can get stuck (#53)
---
 .../org/apache/hadoop/ozone/freon/RandomKeyGenerator.java    | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java
index 2bf79c5..ca30dac 100644
--- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java
+++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java
@@ -113,7 +113,7 @@ public final class RandomKeyGenerator implements Callable<Void> {
       LoggerFactory.getLogger(RandomKeyGenerator.class);
 
   private volatile boolean completed = false;
-  private volatile Exception exception = null;
+  private volatile Throwable exception;
 
   @Option(names = "--numOfThreads",
       description = "number of threads to be launched for the run",
@@ -338,7 +338,7 @@ public final class RandomKeyGenerator implements Callable<Void> {
     }
     ozoneClient.close();
     if (exception != null) {
-      throw exception;
+      throw new RuntimeException(exception);
     }
     return null;
   }
@@ -636,7 +636,7 @@ public final class RandomKeyGenerator implements Callable<Void> {
       OzoneVolume volume = objectStore.getVolume(volumeName);
       volumes.put(volumeNumber, volume);
       return true;
-    } catch (IOException e) {
+    } catch (Throwable e) {
       exception = e;
       LOG.error("Could not create volume", e);
       return false;
@@ -648,6 +648,7 @@ public final class RandomKeyGenerator implements Callable<Void> {
     int bucketNumber = globalBucketNumber / numOfVolumes;
     OzoneVolume volume = getVolume(volumeNumber);
     if (volume == null) {
+      LOG.error("Could not find volume {}", volumeNumber);
       return false;
     }
     String bucketName = "bucket-" + bucketNumber + "-" +
@@ -667,7 +668,7 @@ public final class RandomKeyGenerator implements Callable<Void> {
       OzoneBucket bucket = volume.getBucket(bucketName);
       buckets.put(globalBucketNumber, bucket);
       return true;
-    } catch (IOException e) {
+    } catch (Throwable e) {
       exception = e;
       LOG.error("Could not create bucket ", e);
       return false;
@@ -680,6 +681,7 @@ public final class RandomKeyGenerator implements Callable<Void> {
     long keyNumber = globalKeyNumber / totalBucketCount;
     OzoneBucket bucket = getBucket(globalBucketNumber);
     if (bucket == null) {
+      LOG.error("Could not find bucket {}", globalBucketNumber);
       return false;
     }
     String bucketName = bucket.getName();
@@ -728,7 +730,7 @@ public final class RandomKeyGenerator implements Callable<Void> {
       }
 
       return true;
-    } catch (Exception e) {
+    } catch (Throwable e) {
       exception = e;
       LOG.error("Exception while adding key: {} in bucket: {}" +
           " of volume: {}.", keyName, bucketName, volumeName, e);


---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-commits-help@hadoop.apache.org