Skip to content

Commit 2ec9145

Browse files
committed
optimize porthint in known range
1 parent b389c92 commit 2ec9145

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/Distributed/src/cluster.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ function start_worker(out::IO, cookie_in::Nullable{AbstractString})
207207
init_worker(cookie)
208208
interface = IPv4(LPROC.bind_addr)
209209
if LPROC.bind_port == 0
210-
(port, sock) = listenany(interface, UInt16(0))
210+
port_hint = 9000 + (getpid() % 1000)
211+
(port, sock) = listenany(interface, UInt16(port_hint))
211212
LPROC.bind_port = port
212213
else
213214
sock = listen(interface, LPROC.bind_port)

0 commit comments

Comments
 (0)