File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1278,6 +1278,15 @@ function terminate_all_workers()
12781278 end
12791279end
12801280
1281+ function choose_bind_addr ()
1282+ # On HPC clusters, link-local addresses are usually not usable for
1283+ # communication between compute nodes.
1284+ # Therefore, we use the first non-link-local IPv4 address.
1285+ addrs = Sockets. getipaddrs (Sockets. IPv4)
1286+ filter! (! Sockets. islinklocaladdr, addrs)
1287+ return first (addrs)
1288+ end
1289+
12811290# initialize the local proc network address / port
12821291function init_bind_addr ()
12831292 opts = JLOptions ()
@@ -1292,12 +1301,7 @@ function init_bind_addr()
12921301 else
12931302 bind_port = 0
12941303 try
1295- # On HPC clusters, link-local addresses are usually not usable for
1296- # communication between compute nodes.
1297- # Therefore, we use the first non-link-local IPv4 address.
1298- addrs = Sockets. getipaddrs (Sockets. IPv4)
1299- filter! (! Sockets. islinklocaladdr, addrs)
1300- bind_addr = string (first (addrs))
1304+ bind_addr = string (choose_bind_addr ())
13011305 catch
13021306 # All networking is unavailable, initialize bind_addr to the loopback address
13031307 # Will cause an exception to be raised only when used.
You can’t perform that action at this time.
0 commit comments