File tree 3 files changed +31
-1
lines changed 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ This documents notable changes in DistributedNext.jl. The format is based on
11
11
12
12
### Fixed
13
13
- Fixed a cause of potential hangs when exiting the process ([ #16 ] ).
14
+ - Fixed cases like ` addprocs([("machine 10.1.1.1:9000", 2)]) ` where the bind
15
+ port is specified. Previously this would cause errors when the workers all
16
+ tried to bind to the same port, now all additional workers will treat the bind
17
+ port as a port hint ([ #19 ] ).
14
18
15
19
### Added
16
20
- A watcher mechanism has been added to detect when both the Distributed stdlib
Original file line number Diff line number Diff line change @@ -733,8 +733,29 @@ function launch_additional(np::Integer, cmd::Cmd)
733
733
io_objs = Vector {Any} (undef, np)
734
734
addresses = Vector {Any} (undef, np)
735
735
736
+ worker_cmd = Cmd (cmd)
737
+ bind_idx = findfirst (== (" --bind-to" ), cmd)
738
+ if ! isnothing (bind_idx)
739
+ # The actual bind spec will be the next argument
740
+ bind_idx += 1
741
+
742
+ bind_addr = worker_cmd[bind_idx]
743
+ parts = split (bind_addr, ' :' )
744
+ if length (parts) == 2
745
+ port_str = parts[2 ]
746
+
747
+ # If the port is not specified as a port hint then we convert it
748
+ # to a hint, otherwise the workers will try to bind to the same
749
+ # port and error.
750
+ if ! startswith (port_str, ' [' )
751
+ new_bind_addr = " $(parts[1 ]) :[$(port_str) ]"
752
+ worker_cmd. exec[bind_idx] = new_bind_addr
753
+ end
754
+ end
755
+ end
756
+
736
757
for i in 1 : np
737
- io = open (detach (cmd ), " r+" )
758
+ io = open (detach (worker_cmd ), " r+" )
738
759
write_cookie (io)
739
760
io_objs[i] = io. out
740
761
end
Original file line number Diff line number Diff line change 64
64
@test 8000 >= worker. config. port < 9000
65
65
test_n_remove_pids (new_pids)
66
66
67
+ print (" \n ssh addprocs with multiple workers and port specified\n " )
68
+ new_pids = addprocs_with_testenv ([(" localhost 127.0.0.1:8000" , 2 )]; sshflags= sshflags)
69
+ @test length (new_pids) == 2
70
+ test_n_remove_pids (new_pids)
71
+
67
72
print (" \n ssh addprocs with tunnel\n " )
68
73
new_pids = addprocs_with_testenv ([(" localhost" , num_workers)]; tunnel= true , sshflags= sshflags)
69
74
@test length (new_pids) == num_workers
You can’t perform that action at this time.
0 commit comments