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 2014/06/06 18:46:57 UTC
[4/6] git commit: Adding timeout-check-secs function
Adding timeout-check-secs function
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/402d1313
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/402d1313
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/402d1313
Branch: refs/heads/master
Commit: 402d1313d9277851267ae0d09481711ec7647689
Parents: a918059
Author: Kyle Nusbaum <kn...@yahoo-inc.com>
Authored: Thu Jun 5 18:43:30 2014 +0000
Committer: Kyle Nusbaum <kn...@yahoo-inc.com>
Committed: Thu Jun 5 18:43:30 2014 +0000
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/daemon/drpc.clj | 5 ++---
storm-core/test/clj/backtype/storm/drpc_test.clj | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/402d1313/storm-core/src/clj/backtype/storm/daemon/drpc.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/drpc.clj b/storm-core/src/clj/backtype/storm/daemon/drpc.clj
index 890cfc7..ec56fa7 100644
--- a/storm-core/src/clj/backtype/storm/daemon/drpc.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/drpc.clj
@@ -29,7 +29,7 @@
(bootstrap)
-(def TIMEOUT-CHECK-SECS 5)
+(defn timeout-check-secs [] 5)
(defn acquire-queue [queues-atom function]
(swap! queues-atom
@@ -52,7 +52,6 @@
(swap! id->result dissoc id)
(swap! id->start dissoc id))
my-ip (.getHostAddress (InetAddress/getLocalHost))
- async-repeat-time (or (conf TIMEOUT-CHECK-SECS) TIMEOUT-CHECK-SECS)
clear-thread (async-loop
(fn []
(doseq [[id start] @id->start]
@@ -61,7 +60,7 @@
(.release sem))
(cleanup id)
))
- async-repeat-time
+ (timeout-check-secs)
))
]
(reify DistributedRPC$Iface
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/402d1313/storm-core/test/clj/backtype/storm/drpc_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/drpc_test.clj b/storm-core/test/clj/backtype/storm/drpc_test.clj
index 1fd5ca4..0f7006a 100644
--- a/storm-core/test/clj/backtype/storm/drpc_test.clj
+++ b/storm-core/test/clj/backtype/storm/drpc_test.clj
@@ -225,8 +225,8 @@
(let [queue (ConcurrentLinkedQueue.)
delay-seconds 1]
(stubbing [acquire-queue queue
- read-storm-config {DRPC-REQUEST-TIMEOUT-SECS delay-seconds
- TIMEOUT-CHECK-SECS delay-seconds}]
+ read-storm-config {DRPC-REQUEST-TIMEOUT-SECS delay-seconds}
+ timeout-check-secs delay-seconds]
(let [drpc-handler (service-handler)]
(is (thrown? DRPCExecutionException
(.execute drpc-handler "ArbitraryDRPCFunctionName" "no-args")))))))