Skip to content

Commit 345d305

Browse files
committed
batchspawner/CondorSpawner: Make use of connect_to_job rport feature.
This uses the functionality to use a random local port on the hub to forward the notebook port to. It ensures no port collisions appear between different, forwarded notebooks.
1 parent 6c5e850 commit 345d305

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

batchspawner/batchspawner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ class CondorSpawner(UserEnvMixin,BatchSpawnerRegexStates):
901901
# outputs job data XML string
902902
batch_query_cmd = Unicode('condor_q {job_id} -format "%s, " JobStatus -format "%s" RemoteHost -format "\n" True').tag(config=True)
903903
batch_cancel_cmd = Unicode('condor_rm {job_id}').tag(config=True)
904-
connect_to_job_cmd = Unicode("condor_ssh_to_job -ssh \"ssh -L {port}:localhost:{port} -oExitOnForwardFailure=yes\" {job_id}").tag(config=True)
904+
connect_to_job_cmd = Unicode("condor_ssh_to_job -ssh \"ssh -L {port}:localhost:{rport} -oExitOnForwardFailure=yes\" {job_id}").tag(config=True)
905905
# job status: 1 = pending, 2 = running
906906
state_pending_re = Unicode(r'^1,').tag(config=True)
907907
state_running_re = Unicode(r'^2,').tag(config=True)

0 commit comments

Comments
 (0)