Skip to content

Commit 3a6e57e

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 cf13419 commit 3a6e57e

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
@@ -908,7 +908,7 @@ class CondorSpawner(UserEnvMixin,BatchSpawnerRegexStates):
908908
# outputs job data XML string
909909
batch_query_cmd = Unicode('condor_q {job_id} -format "%s, " JobStatus -format "%s" RemoteHost -format "\n" True').tag(config=True)
910910
batch_cancel_cmd = Unicode('condor_rm {job_id}').tag(config=True)
911-
connect_to_job_cmd = Unicode("condor_ssh_to_job -ssh \"ssh -L {port}:localhost:{port} -oExitOnForwardFailure=yes\" {job_id}").tag(config=True)
911+
connect_to_job_cmd = Unicode("condor_ssh_to_job -ssh \"ssh -L {port}:localhost:{rport} -oExitOnForwardFailure=yes\" {job_id}").tag(config=True)
912912
# job status: 1 = pending, 2 = running
913913
state_pending_re = Unicode(r'^1,').tag(config=True)
914914
state_running_re = Unicode(r'^2,').tag(config=True)

0 commit comments

Comments
 (0)