Skip to content

Commit 3e14a60

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 d778f08 commit 3e14a60

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
@@ -1015,7 +1015,7 @@ class CondorSpawner(UserEnvMixin, BatchSpawnerRegexStates):
10151015
'condor_q {job_id} -format "%s, " JobStatus -format "%s" RemoteHost -format "\n" True'
10161016
).tag(config=True)
10171017
batch_cancel_cmd = Unicode("condor_rm {job_id}").tag(config=True)
1018-
connect_to_job_cmd = Unicode("condor_ssh_to_job -ssh \"ssh -L {port}:localhost:{port} -oExitOnForwardFailure=yes\" {job_id}").tag(config=True)
1018+
connect_to_job_cmd = Unicode("condor_ssh_to_job -ssh \"ssh -L {port}:localhost:{rport} -oExitOnForwardFailure=yes\" {job_id}").tag(config=True)
10191019
# job status: 1 = pending, 2 = running
10201020
state_pending_re = Unicode(r"^1,").tag(config=True)
10211021
state_running_re = Unicode(r"^2,").tag(config=True)

0 commit comments

Comments
 (0)