Permalink
Browse files

This solves race condition in unit tests if you try to shutdown a wor…

…ker which cleans up worker state while you also try to wait for worker to launch by reading the same

state.
  • Loading branch information...
1 parent 92586a4 commit b7fbd28ba03c63a6a1c96e0cbfc7b813c185e902 Jason Jackson committed Mar 26, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/clj/backtype/storm/daemon/supervisor.clj
@@ -112,7 +112,12 @@
(defn- wait-for-worker-launch [conf id start-time]
(let [state (worker-state conf id)]
(loop []
- (let [hb (.get state LS-WORKER-HEARTBEAT)]
+ (let [hb (try (.get state LS-WORKER-HEARTBEAT)
+ (catch java.io.FileNotFoundException e
+ ;; This solves race condition in unit tests if you try to shutdown
+ ;; a worker which cleans up worker state while you also try to wait
+ ;; for worker to launch by reading the same state.
+ nil))]
(when (and
(not hb)
(<

0 comments on commit b7fbd28

Please sign in to comment.