Skip to content

Commit 51fe0e4

Browse files
authored
Merge pull request #117 from JuliaLang/timeout
Replace a timeout task with timedwait()
2 parents 3a43532 + 766f8c3 commit 51fe0e4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/cluster.jl

+2-4
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,9 @@ function create_worker(manager, wconfig)
683683
send_msg_now(w, MsgHeader(RRID(0,0), ntfy_oid), join_message)
684684

685685
@async manage(w.manager, w.id, w.config, :register)
686+
686687
# wait for rr_ntfy_join with timeout
687-
timedout = false
688-
@async (sleep($timeout); timedout = true; put!(rr_ntfy_join, 1))
689-
wait(rr_ntfy_join)
690-
if timedout
688+
if timedwait(() -> isready(rr_ntfy_join), timeout) === :timed_out
691689
error("worker did not connect within $timeout seconds")
692690
end
693691
lock(client_refs) do

0 commit comments

Comments
 (0)