You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2015/04/13 23:11:30 UTC
[1/5] storm git commit: STORM-757: Simulated time can leak out on
errors
Repository: storm
Updated Branches:
refs/heads/master 6b52e0d88 -> 5d26f715d
STORM-757: Simulated time can leak out on errors
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/b77efd3a
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/b77efd3a
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/b77efd3a
Branch: refs/heads/master
Commit: b77efd3a7cf889cf64e8e5a996f03aadb77b2b6e
Parents: a6935d4
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Mon Apr 6 16:06:55 2015 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Mon Apr 6 16:06:55 2015 -0500
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/testing.clj | 12 ++++++------
storm-core/src/clj/backtype/storm/util.clj | 5 -----
.../test/clj/backtype/storm/security/auth/auth_test.clj | 4 ++--
.../clj/backtype/storm/security/auth/drpc_auth_test.clj | 6 +++---
.../backtype/storm/security/auth/nimbus_auth_test.clj | 4 ++--
5 files changed, 13 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/b77efd3a/storm-core/src/clj/backtype/storm/testing.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/testing.clj b/storm-core/src/clj/backtype/storm/testing.clj
index 02bf13d..57a1cd3 100644
--- a/storm-core/src/clj/backtype/storm/testing.clj
+++ b/storm-core/src/clj/backtype/storm/testing.clj
@@ -79,13 +79,13 @@
[]
(Time/stopSimulating))
-(defmacro with-simulated-time
- [& body]
- `(do
+ (defmacro with-simulated-time
+ [& body]
+ `(try
(start-simulating-time!)
- (let [ret# (do ~@body)]
- (stop-simulating-time!)
- ret#)))
+ ~@body
+ (finally
+ (stop-simulating-time!))))
(defn advance-time-ms! [ms]
(Time/advanceTime ms))
http://git-wip-us.apache.org/repos/asf/storm/blob/b77efd3a/storm-core/src/clj/backtype/storm/util.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/util.clj b/storm-core/src/clj/backtype/storm/util.clj
index 36dc62c..3992017 100644
--- a/storm-core/src/clj/backtype/storm/util.clj
+++ b/storm-core/src/clj/backtype/storm/util.clj
@@ -615,11 +615,6 @@
~@body
(finally (.unlock wlock#))))))
-(defn wait-for-condition
- [apredicate]
- (while (not (apredicate))
- (Time/sleep 100)))
-
(defn time-delta
[time-secs]
(- (current-time-secs) time-secs))
http://git-wip-us.apache.org/repos/asf/storm/blob/b77efd3a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
index ddd5e03..6dcce46 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
@@ -26,7 +26,7 @@
(:import [java.net InetAddress])
(:import [backtype.storm Config])
(:import [backtype.storm.generated AuthorizationException])
- (:import [backtype.storm.utils NimbusClient])
+ (:import [backtype.storm.utils NimbusClient Time])
(:import [backtype.storm.security.auth.authorizer SimpleWhitelistAuthorizer SimpleACLAuthorizer])
(:import [backtype.storm.security.auth AuthUtils ThriftServer ThriftClient ShellBasedGroupsMapping
ReqContext SimpleTransportPlugin KerberosPrincipalToLocal ThriftConnectionType])
@@ -137,7 +137,7 @@
ThriftConnectionType/NIMBUS)]
(.addShutdownHook (Runtime/getRuntime) (Thread. (fn [] (.stop server))))
(.start (Thread. #(.serve server)))
- (wait-for-condition #(.isServing server))
+ (while-timeout 5000 (.isServing server) (Time/sleep 100))
server ))
(defmacro with-server [args & body]
http://git-wip-us.apache.org/repos/asf/storm/blob/b77efd3a/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
index b6ede3b..e56d54c 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
@@ -21,7 +21,7 @@
DistributedRPCInvocations$Processor])
(:import [backtype.storm Config])
(:import [backtype.storm.security.auth ReqContext SingleUserPrincipal ThriftServer ThriftConnectionType])
- (:import [backtype.storm.utils DRPCClient])
+ (:import [backtype.storm.utils DRPCClient Time])
(:import [backtype.storm.drpc DRPCInvocationsClient])
(:import [java.util.concurrent TimeUnit])
(:import [javax.security.auth Subject])
@@ -48,10 +48,10 @@
(log-message "storm conf:" conf)
(log-message "Starting DRPC invocation server ...")
(.start (Thread. #(.serve invoke-server)))
- (wait-for-condition #(.isServing invoke-server))
+ (while-timeout 5000 (.isServing invoke-server) (Time/sleep 100))
(log-message "Starting DRPC handler server ...")
(.start (Thread. #(.serve handler-server)))
- (wait-for-condition #(.isServing handler-server))
+ (while-timeout 5000 (.isServing handler-server) (Time/sleep 100))
[handler-server invoke-server]))
(defmacro with-server [args & body]
http://git-wip-us.apache.org/repos/asf/storm/blob/b77efd3a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
index 0a9c280..8f640bd 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
@@ -20,7 +20,7 @@
(:require [backtype.storm [zookeeper :as zk]])
(:import [java.nio ByteBuffer])
(:import [backtype.storm Config])
- (:import [backtype.storm.utils NimbusClient])
+ (:import [backtype.storm.utils NimbusClient Time])
(:import [backtype.storm.generated NotAliveException])
(:import [backtype.storm.security.auth AuthUtils ThriftServer ThriftClient
ReqContext ThriftConnectionType])
@@ -46,7 +46,7 @@
ThriftConnectionType/NIMBUS)]
(.addShutdownHook (Runtime/getRuntime) (Thread. (fn [] (.stop nimbus-server))))
(.start (Thread. #(.serve nimbus-server)))
- (wait-for-condition #(.isServing nimbus-server))
+ (testing/while-timeout 5000 (.isServing nimbus-server) (Time/sleep 100))
[cluster-map nimbus-server]))
(defmacro with-test-cluster [args & body]
[4/5] storm git commit: Merge branch 'STORM-757' of
https://github.com/revans2/incubator-storm into STORM-575
Posted by bo...@apache.org.
Merge branch 'STORM-757' of https://github.com/revans2/incubator-storm into STORM-575
STORM-757: Simulated time can leak out on errors
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/0bef615a
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/0bef615a
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/0bef615a
Branch: refs/heads/master
Commit: 0bef615ad3dfb8ec7ec9f9940eba88964dfe7dec
Parents: 6b52e0d f4e48e5
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Mon Apr 13 16:03:02 2015 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Mon Apr 13 16:03:02 2015 -0500
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/testing.clj | 19 +++++++++++++------
storm-core/src/clj/backtype/storm/util.clj | 5 -----
.../storm/security/auth/nimbus_auth_test.clj | 2 +-
3 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
[3/5] storm git commit: Addressed review comments
Posted by bo...@apache.org.
Addressed review comments
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/f4e48e5b
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/f4e48e5b
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/f4e48e5b
Branch: refs/heads/master
Commit: f4e48e5b046b5853d2294061a31587c629458cee
Parents: e2e7c87
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Fri Apr 10 09:27:41 2015 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Fri Apr 10 09:27:41 2015 -0500
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/testing.clj | 7 +++++++
.../test/clj/backtype/storm/security/auth/auth_test.clj | 4 ++--
.../test/clj/backtype/storm/security/auth/drpc_auth_test.clj | 6 +++---
.../clj/backtype/storm/security/auth/nimbus_auth_test.clj | 4 ++--
4 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/f4e48e5b/storm-core/src/clj/backtype/storm/testing.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/testing.clj b/storm-core/src/clj/backtype/storm/testing.clj
index 57a1cd3..687dab1 100644
--- a/storm-core/src/clj/backtype/storm/testing.clj
+++ b/storm-core/src/clj/backtype/storm/testing.clj
@@ -203,6 +203,13 @@
~@body)
(log-debug "Condition met " '~condition)))
+(defn wait-for-condition
+ ([apredicate]
+ (wait-for-condition TEST-TIMEOUT-MS apredicate))
+ ([timeout-ms apredicate]
+ (while-timeout timeout-ms (not (apredicate))
+ (Time/sleep 100))))
+
(defn wait-until-cluster-waiting
"Wait until the cluster is idle. Should be used with time simulation."
([cluster-map] (wait-until-cluster-waiting cluster-map TEST-TIMEOUT-MS))
http://git-wip-us.apache.org/repos/asf/storm/blob/f4e48e5b/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
index d83a2c4..ddd5e03 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
@@ -26,7 +26,7 @@
(:import [java.net InetAddress])
(:import [backtype.storm Config])
(:import [backtype.storm.generated AuthorizationException])
- (:import [backtype.storm.utils NimbusClient Time])
+ (:import [backtype.storm.utils NimbusClient])
(:import [backtype.storm.security.auth.authorizer SimpleWhitelistAuthorizer SimpleACLAuthorizer])
(:import [backtype.storm.security.auth AuthUtils ThriftServer ThriftClient ShellBasedGroupsMapping
ReqContext SimpleTransportPlugin KerberosPrincipalToLocal ThriftConnectionType])
@@ -137,7 +137,7 @@
ThriftConnectionType/NIMBUS)]
(.addShutdownHook (Runtime/getRuntime) (Thread. (fn [] (.stop server))))
(.start (Thread. #(.serve server)))
- (while-timeout 5000 (not (.isServing server)) (Time/sleep 100))
+ (wait-for-condition #(.isServing server))
server ))
(defmacro with-server [args & body]
http://git-wip-us.apache.org/repos/asf/storm/blob/f4e48e5b/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
index 5b57eb1..b6ede3b 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
@@ -21,7 +21,7 @@
DistributedRPCInvocations$Processor])
(:import [backtype.storm Config])
(:import [backtype.storm.security.auth ReqContext SingleUserPrincipal ThriftServer ThriftConnectionType])
- (:import [backtype.storm.utils DRPCClient Time])
+ (:import [backtype.storm.utils DRPCClient])
(:import [backtype.storm.drpc DRPCInvocationsClient])
(:import [java.util.concurrent TimeUnit])
(:import [javax.security.auth Subject])
@@ -48,10 +48,10 @@
(log-message "storm conf:" conf)
(log-message "Starting DRPC invocation server ...")
(.start (Thread. #(.serve invoke-server)))
- (while-timeout 5000 (not (.isServing invoke-server)) (Time/sleep 100))
+ (wait-for-condition #(.isServing invoke-server))
(log-message "Starting DRPC handler server ...")
(.start (Thread. #(.serve handler-server)))
- (while-timeout 5000 (not (.isServing handler-server)) (Time/sleep 100))
+ (wait-for-condition #(.isServing handler-server))
[handler-server invoke-server]))
(defmacro with-server [args & body]
http://git-wip-us.apache.org/repos/asf/storm/blob/f4e48e5b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
index b4c7d2e..01c08ea 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
@@ -20,7 +20,7 @@
(:require [backtype.storm [zookeeper :as zk]])
(:import [java.nio ByteBuffer])
(:import [backtype.storm Config])
- (:import [backtype.storm.utils NimbusClient Time])
+ (:import [backtype.storm.utils NimbusClient])
(:import [backtype.storm.generated NotAliveException])
(:import [backtype.storm.security.auth AuthUtils ThriftServer ThriftClient
ReqContext ThriftConnectionType])
@@ -46,7 +46,7 @@
ThriftConnectionType/NIMBUS)]
(.addShutdownHook (Runtime/getRuntime) (Thread. (fn [] (.stop nimbus-server))))
(.start (Thread. #(.serve nimbus-server)))
- (testing/while-timeout 5000 (not (.isServing nimbus-server)) (Time/sleep 100))
+ (testing/wait-for-condition #(.isServing nimbus-server))
[cluster-map nimbus-server]))
(defmacro with-test-cluster [args & body]
[2/5] storm git commit: Fixed issue with going from until to while
Posted by bo...@apache.org.
Fixed issue with going from until to while
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/e2e7c871
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/e2e7c871
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/e2e7c871
Branch: refs/heads/master
Commit: e2e7c8714a5651beed3b72db6c2186a458940a36
Parents: b77efd3
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Tue Apr 7 12:28:39 2015 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Tue Apr 7 12:28:39 2015 -0500
----------------------------------------------------------------------
storm-core/test/clj/backtype/storm/security/auth/auth_test.clj | 2 +-
.../test/clj/backtype/storm/security/auth/drpc_auth_test.clj | 4 ++--
.../test/clj/backtype/storm/security/auth/nimbus_auth_test.clj | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/e2e7c871/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
index 6dcce46..d83a2c4 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/auth_test.clj
@@ -137,7 +137,7 @@
ThriftConnectionType/NIMBUS)]
(.addShutdownHook (Runtime/getRuntime) (Thread. (fn [] (.stop server))))
(.start (Thread. #(.serve server)))
- (while-timeout 5000 (.isServing server) (Time/sleep 100))
+ (while-timeout 5000 (not (.isServing server)) (Time/sleep 100))
server ))
(defmacro with-server [args & body]
http://git-wip-us.apache.org/repos/asf/storm/blob/e2e7c871/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
index e56d54c..5b57eb1 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/drpc_auth_test.clj
@@ -48,10 +48,10 @@
(log-message "storm conf:" conf)
(log-message "Starting DRPC invocation server ...")
(.start (Thread. #(.serve invoke-server)))
- (while-timeout 5000 (.isServing invoke-server) (Time/sleep 100))
+ (while-timeout 5000 (not (.isServing invoke-server)) (Time/sleep 100))
(log-message "Starting DRPC handler server ...")
(.start (Thread. #(.serve handler-server)))
- (while-timeout 5000 (.isServing handler-server) (Time/sleep 100))
+ (while-timeout 5000 (not (.isServing handler-server)) (Time/sleep 100))
[handler-server invoke-server]))
(defmacro with-server [args & body]
http://git-wip-us.apache.org/repos/asf/storm/blob/e2e7c871/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
index 8f640bd..b4c7d2e 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
@@ -46,7 +46,7 @@
ThriftConnectionType/NIMBUS)]
(.addShutdownHook (Runtime/getRuntime) (Thread. (fn [] (.stop nimbus-server))))
(.start (Thread. #(.serve nimbus-server)))
- (testing/while-timeout 5000 (.isServing nimbus-server) (Time/sleep 100))
+ (testing/while-timeout 5000 (not (.isServing nimbus-server)) (Time/sleep 100))
[cluster-map nimbus-server]))
(defmacro with-test-cluster [args & body]
[5/5] storm git commit: Added STORM-757 to changelog
Posted by bo...@apache.org.
Added STORM-757 to changelog
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/5d26f715
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/5d26f715
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/5d26f715
Branch: refs/heads/master
Commit: 5d26f715d8a1f731fa3586c10d46a3a24174f97b
Parents: 0bef615
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Mon Apr 13 16:10:01 2015 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Mon Apr 13 16:10:01 2015 -0500
----------------------------------------------------------------------
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/5d26f715/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7c951ee..062820f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
## 0.11.0
+ * STORM-757: Simulated time can leak out on errors
* STORM-694: java.lang.ClassNotFoundException: backtype.storm.daemon.common.SupervisorInfo
* STORM-750: Set Config serialVersionUID
* STORM-713: Include topic information with Kafka metrics.