Skip to content

Commit 86a0e9c

Browse files
amitmurthyararslan
authored andcommitted
Only listen on a port starting from 9009
Partially reverts #21818. Fixes #24722.
1 parent 3522df1 commit 86a0e9c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

NEWS.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ This section lists changes that do not have deprecation warnings.
259259
rather than from environment variables ([#19636]).
260260
261261
* Workers now listen on an ephemeral port assigned by the OS. Previously workers would
262-
listen on the first free port available from 9009 ([#21818]).
262+
listen on the first free port available from 9009 ([#21818]). Version 0.6.1 only.
263+
Reverted in 0.6.2
263264
264265
265266
Library improvements

base/distributed/cluster.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function start_worker(out::IO, cookie::AbstractString)
153153
init_worker(cookie)
154154
interface = IPv4(LPROC.bind_addr)
155155
if LPROC.bind_port == 0
156-
(port, sock) = listenany(interface, UInt16(0))
156+
(port, sock) = listenany(interface, UInt16(9009))
157157
LPROC.bind_port = port
158158
else
159159
sock = listen(interface, LPROC.bind_port)

doc/src/manual/parallel-computing.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,8 @@ as local laptops, departmental clusters, or even the cloud. This section covers
12311231
requirements for the inbuilt `LocalManager` and `SSHManager`:
12321232

12331233
* The master process does not listen on any port. It only connects out to the workers.
1234-
* Each worker binds to only one of the local interfaces and listens on an ephemeral port number
1235-
assigned by the OS.
1234+
* Each worker binds to only one of the local interfaces and listens on the first free port starting
1235+
from `9009`.
12361236
* `LocalManager`, used by `addprocs(N)`, by default binds only to the loopback interface. This means
12371237
that workers started later on remote hosts (or by anyone with malicious intentions) are unable
12381238
to connect to the cluster. An `addprocs(4)` followed by an `addprocs(["remote_host"])` will fail.
@@ -1250,9 +1250,8 @@ requirements for the inbuilt `LocalManager` and `SSHManager`:
12501250
authenticated via public key infrastructure (PKI). Authentication credentials can be supplied
12511251
via `sshflags`, for example ```sshflags=`-e <keyfile>` ```.
12521252

1253-
In an all-to-all topology (the default), all workers connect to each other via plain TCP sockets.
1254-
The security policy on the cluster nodes must thus ensure free connectivity between workers for
1255-
the ephemeral port range (varies by OS).
1253+
Note that worker-worker connections are still plain TCP and the local security policy on the remote
1254+
cluster must allow for free connections between worker nodes, at least for ports 9009 and above.
12561255

12571256
Securing and encrypting all worker-worker traffic (via SSH) or encrypting individual messages
12581257
can be done via a custom ClusterManager.

0 commit comments

Comments
 (0)