Skip to content

Commit 0c450de

Browse files
master connection through pubhost to allow tunnel=false
1 parent f38f119 commit 0c450de

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/cluster.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function read_worker_host_port(io::IO)
350350
throw(LaunchWorkerError("Unable to read host:port string from worker. Launch command exited with error?"))
351351
end
352352

353-
#@error "conninfo: $conninfo"
353+
@info "conninfo: $conninfo"
354354

355355
ntries -= 1
356356
bind_addr, port = parse_connection_info(conninfo)

src/managers.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ function parse_machine(machine::AbstractString)
232232
end
233233

234234
function launch_on_machine(manager::SSHManager, machine::AbstractString, cnt, params::Dict, launched::Array, launch_ntfy::Condition)
235-
#@info "launch_on_machine"
235+
236236
shell = params[:shell]
237237
ssh = params[:ssh]
238238
dir = params[:dir]
@@ -598,8 +598,9 @@ function connect(manager::ClusterManager, pid::Int, config::WorkerConfig)
598598
# master connecting to workers
599599
if config.io !== nothing
600600
(bind_addr, port::Int) = read_worker_host_port(config.io)
601-
#@info "CONNECT W2 $bind_addr $port"
601+
# @info "CONNECT W2 $bind_addr $port $(config.host) $(config.bind_addr)"
602602
pubhost = something(config.host, bind_addr)
603+
# @info "CONNECT W21 $pubhost"
603604
config.host = pubhost
604605
config.port = port
605606
else
@@ -641,7 +642,7 @@ function connect(manager::ClusterManager, pid::Int, config::WorkerConfig)
641642
release(sem)
642643
end
643644
else
644-
(s, bind_addr) = connect_to_worker(bind_addr, port)
645+
(s, bind_addr) = connect_to_worker(#=bind_addr=# pubhost, port)
645646
end
646647

647648
config.bind_addr = bind_addr
@@ -703,6 +704,9 @@ function bind_client_port(sock::TCPSocket, iptype)
703704
end
704705

705706
function connect_to_worker(host::AbstractString, port::Integer)
707+
708+
# @info "--------- CONNECT TO WORKER $host $port"
709+
706710
# Avoid calling getaddrinfo if possible - involves a DNS lookup
707711
# host may be a stringified ipv4 / ipv6 address or a dns name
708712
bind_addr = nothing
@@ -714,7 +718,6 @@ function connect_to_worker(host::AbstractString, port::Integer)
714718

715719

716720
iptype = typeof(bind_addr)
717-
#@info "connect_to_worker: $host $port $bind_addr $iptype"
718721
sock = socket_reuse_port(iptype)
719722
connect(sock, bind_addr, UInt16(port))
720723

@@ -723,6 +726,9 @@ end
723726

724727

725728
function connect_to_worker_with_tunnel(host::AbstractString, bind_addr::AbstractString, port::Integer, tunnel_user::AbstractString, sshflags, multiplex)
729+
730+
# @info "++++++++ CONNECT TO WORKER WITH TUNNEL host=$host port=$port bind_addr=$bind_addr tunnel_user=$tunnel_user sshflags=$sshflags multiplex=$multiplex"
731+
726732
localport = ssh_tunnel(tunnel_user, host, bind_addr, UInt16(port), sshflags, multiplex)
727733
s = connect("localhost", localport)
728734
forward = "$localport:$bind_addr:$port"

0 commit comments

Comments
 (0)