Skip to content

Commit

Permalink
fix #28499, calling cluster_cookie before cluster starts (#28656)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored Aug 15, 2018
1 parent d4b50d3 commit e7f3bb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cluster.jl
Original file line number Diff line number Diff line change
Expand Up @@ -644,14 +644,15 @@ end
Return the cluster cookie.
"""
cluster_cookie() = LPROC.cookie
cluster_cookie() = (init_multi(); LPROC.cookie)

"""
cluster_cookie(cookie) -> cookie
Set the passed cookie as the cluster cookie, then returns it.
"""
function cluster_cookie(cookie)
init_multi()
# The cookie must be an ASCII string with length <= HDR_COOKIE_LEN
@assert isascii(cookie)
@assert length(cookie) <= HDR_COOKIE_LEN
Expand Down
2 changes: 2 additions & 0 deletions test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Test, Distributed, Random, Serialization, Sockets
import Distributed: launch, manage

@test cluster_cookie() isa String

include(joinpath(Sys.BINDIR, "..", "share", "julia", "test", "testenv.jl"))

@test Distributed.extract_imports(:(begin; import Foo, Bar; let; using Baz; end; end)) ==
Expand Down

0 comments on commit e7f3bb3

Please sign in to comment.