Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
strudel2_backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
strudel2_backend
Commits
44b4d4aa
Commit
44b4d4aa
authored
2 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
I think I found the lock error
parent
5b7f4c31
No related branches found
Branches containing commit
No related tags found
2 merge requests
!97
Test
,
!96
Dev
Pipeline
#70108
passed
2 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tes/sshwrapper/__init__.py
+11
-4
11 additions, 4 deletions
tes/sshwrapper/__init__.py
with
11 additions
and
4 deletions
tes/sshwrapper/__init__.py
+
11
−
4
View file @
44b4d4aa
...
...
@@ -98,8 +98,10 @@ class Ssh:
@staticmethod
def
check_ctrlsocket
(
sess
,
ctrlsocket
):
cmd
=
[
'
ssh
'
,
'
-S
'
,
ctrlsocket
,
'
-O
'
,
'
check
'
,
'
-l
'
,
'
noone
'
,
'
nohost
'
]
check_p
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdin
=
None
)
(
stderr
,
stdout
)
=
check_p
.
communicate
(
timeout
=
Ssh
.
TIMEOUT
)
try
:
check_p
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdin
=
None
)
(
stderr
,
stdout
)
=
check_p
.
communicate
(
timeout
=
Ssh
.
TIMEOUT
)
return
check_p
.
returncode
==
0
@staticmethod
...
...
@@ -115,9 +117,14 @@ class Ssh:
logger
.
debug
(
"
enter get_ctrl_master_socket
"
)
ctrlsocket
=
"
/tmp/cm-{}-{}-{}
"
.
format
(
user
,
host
,
sess
.
sshsessid
)
sess
.
lock
.
acquire
()
if
Ssh
.
check_ctrlsocket
(
sess
,
ctrlsocket
):
try
:
if
Ssh
.
check_ctrlsocket
(
sess
,
ctrlsocket
):
sess
.
lock
.
release
()
return
ctrlsocket
except
subprocess
.
TimeoutExpired
as
e
:
sess
.
lock
.
release
()
return
ctrlsocket
raise
e
try
:
mode
=
os
.
stat
(
ctrlsocket
).
st_mode
logger
.
debug
(
'
removing stale control socket
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment