From 5870590ddd8de79512388843c826761863a65a6c Mon Sep 17 00:00:00 2001
From: ivan <ivan@ivanLaptop>
Date: Mon, 24 Aug 2015 14:33:01 +0200
Subject: [PATCH] modified cleanup

---
 s3/src/main/java/com/yahoo/ycsb/db/S3Client.java | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java b/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java
index fc59c85a..ffe19b80 100644
--- a/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java
+++ b/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java
@@ -72,11 +72,14 @@ public class S3Client extends DB {
   */
   @Override
   public void cleanup() throws DBException {
-    try {
-      this.s3Client.shutdown(); //this should not be used
-      //this.s3Client = null;
-    } catch (Exception e){
-      e.printStackTrace();
+    if(this.s3Client != null){
+      try {
+        this.s3Client.shutdown();
+      } catch (Exception e){
+        e.printStackTrace();
+      } finally {
+        this.s3Client = null;
+      }
     }
   }
   /**
-- 
GitLab