You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2016/09/15 23:53:13 UTC

[1/2] kudu git commit: [java client] make DateFormat safe to use

Repository: kudu
Updated Branches:
  refs/heads/master 1eb24183a -> af7f9c805


[java client] make DateFormat safe to use

Todd's error-prone patch discovered this problem in RowResult where
we use a static DateFormat from multiple threads. The recommended way
to do this is to use thread locals.

Change-Id: I6d18ba34db0a0782fd0b7401e9aea7ae59c6b6f6
Reviewed-on: http://gerrit.cloudera.org:8080/4429
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/b0b273e8
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/b0b273e8
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/b0b273e8

Branch: refs/heads/master
Commit: b0b273e8271752b6eb04ba163981aad1c792e413
Parents: 1eb2418
Author: Jean-Daniel Cryans <jd...@apache.org>
Authored: Thu Sep 15 16:21:23 2016 -0700
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Thu Sep 15 23:51:10 2016 +0000

----------------------------------------------------------------------
 .../java/org/apache/kudu/client/RowResult.java     | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b0b273e8/java/kudu-client/src/main/java/org/apache/kudu/client/RowResult.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/RowResult.java b/java/kudu-client/src/main/java/org/apache/kudu/client/RowResult.java
index 0ef3e03..64871d9 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/RowResult.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/RowResult.java
@@ -39,10 +39,17 @@ import java.util.TimeZone;
 public class RowResult {
 
   private static final int INDEX_RESET_LOCATION = -1;
-  private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
-  static {
-    DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
-  }
+
+  // Thread local DateFormat since they're not thread-safe.
+  private static final ThreadLocal<DateFormat> DATE_FORMAT = new ThreadLocal<DateFormat>(){
+    @Override
+    protected DateFormat initialValue() {
+      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
+      sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
+      return sdf;
+    }
+  };
+
   private static final long MS_IN_S = 1000L;
   private static final long US_IN_S = 1000L * 1000L;
   private int index = INDEX_RESET_LOCATION;
@@ -513,7 +520,7 @@ public class RowResult {
     long tsMillis = timestamp / MS_IN_S;
     long tsMicros = timestamp % US_IN_S;
     StringBuffer formattedTs = new StringBuffer();
-    DATE_FORMAT.format(new Date(tsMillis), formattedTs, new FieldPosition(0));
+    DATE_FORMAT.get().format(new Date(tsMillis), formattedTs, new FieldPosition(0));
     formattedTs.append(String.format(".%06dZ", tsMicros));
     return formattedTs.toString();
   }


[2/2] kudu git commit: webserver-stress-itest: increase timeouts

Posted by ad...@apache.org.
webserver-stress-itest: increase timeouts

The flaky test dashboard shows a lot of ASAN and TSAN failures while waiting
for tablets to start running, so let's drastically increase that timeout.

Additionally, some ASAN builds timed out while creating the test table, so
let's also reduce the number of checkers run in ASAN.

Change-Id: I7fb042be33af0b4ecbdc39af471eab3e1c872d53
Reviewed-on: http://gerrit.cloudera.org:8080/4427
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/af7f9c80
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/af7f9c80
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/af7f9c80

Branch: refs/heads/master
Commit: af7f9c805c96b6ce6854105b369b6d02fbe7105a
Parents: b0b273e
Author: Adar Dembo <ad...@cloudera.com>
Authored: Thu Sep 15 13:44:58 2016 -0700
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Thu Sep 15 23:51:18 2016 +0000

----------------------------------------------------------------------
 src/kudu/integration-tests/webserver-stress-itest.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/af7f9c80/src/kudu/integration-tests/webserver-stress-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/webserver-stress-itest.cc b/src/kudu/integration-tests/webserver-stress-itest.cc
index 903e3bb..d108993 100644
--- a/src/kudu/integration-tests/webserver-stress-itest.cc
+++ b/src/kudu/integration-tests/webserver-stress-itest.cc
@@ -36,8 +36,8 @@ using std::vector;
 
 // Tests that pounding the web UI doesn't cause any crashes.
 TEST_F(KuduTest, TestWebUIDoesNotCrashCluster) {
-#ifdef THREAD_SANITIZER
-  // When using TSAN, more than one checker is too much load on the cluster.
+#if defined(THREAD_SANITIZER) || defined(ADDRESS_SANITIZER)
+  // When using a sanitizer, checkers place a lot of load on the cluster.
   const int kWebUICheckers = 1;
 #else
   const int kWebUICheckers = 10;
@@ -78,7 +78,7 @@ TEST_F(KuduTest, TestWebUIDoesNotCrashCluster) {
   ASSERT_OK(cluster.Restart());
   ASSERT_OK(cluster.WaitForTabletsRunning(cluster.tablet_server(0),
                                           kNumTablets,
-                                          MonoDelta::FromSeconds(30)));
+                                          MonoDelta::FromSeconds(180)));
   NO_FATALS(cluster.AssertNoCrashes());
 }