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
3398cb4e
Commit
3398cb4e
authored
4 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
more fixy
parent
83a40068
No related branches found
No related tags found
3 merge requests
!77
Revert "disable agressive kill and restart"
,
!45
Test
,
!44
Dev
Pipeline
#11957
passed
4 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
+15
-24
15 additions, 24 deletions
tes/sshwrapper/__init__.py
with
15 additions
and
24 deletions
tes/sshwrapper/__init__.py
+
15
−
24
View file @
3398cb4e
...
...
@@ -157,34 +157,25 @@ class Ssh:
logger
.
debug
(
"
spanwed ssh mux with pid {}
"
.
format
(
ctrl_p
.
pid
))
#sess.pids.append(ctrl_p.pid)
sess
.
ctrl_processes
[
ctrlsocket
]
=
ctrl_p
DOUBLECHECK
=
True
if
DOUBLECHECK
:
import
time
time
.
sleep
(
1
)
notstarted
=
True
notdead
=
True
wait
=
0
while
notstarted
and
notdead
:
ctrl_p
.
poll
()
if
ctrl_p
.
returncode
!=
None
:
notdead
=
False
(
stdout
,
stderr
)
=
ctrl_p
.
communicate
()
logger
.
error
(
'
ctrl_p died {} {} {}
'
.
format
(
ctrl_p
.
returncode
,
stdout
,
stderr
))
else
:
ctrl_p
=
sess
.
ctrl_processes
[
ctrlsocket
]
try
:
mode
=
os
.
stat
(
ctrlsocket
).
st_mode
except
FileNotFoundError
:
import
time
time
.
sleep
(
5
)
try
:
mode
=
os
.
stat
(
ctrlsocket
).
st_mode
except
FileNotFoundError
:
mode
=
None
ctrl_p
.
kill
()
(
stdout
,
stderr
)
=
ctrl_p
.
communicate
()
logger
.
error
(
'
control socket error {} {}
'
.
format
(
stdout
,
stderr
))
raise
SshCtrlException
(
stderr
.
decode
())
if
not
stat
.
S_ISSOCK
(
mode
):
ctrl_p
.
kill
()
(
stdout
,
stderr
)
=
ctrl_p
.
communicate
()
logger
.
error
(
'
control socket error {} {}
'
.
format
(
stdout
,
stderr
))
raise
SshCtrlException
(
stderr
.
decode
())
raise
SshCtrlException
(
stderr
.
decode
())
try
:
mode
=
os
.
stat
(
ctrlsocket
).
st_mode
notstarted
=
False
except
FileNotFoundError
:
logger
.
debug
(
'
ctrl_p not started yet
'
)
time
.
sleep
(
0.5
)
wait
=
wait
+
1
if
wait
>
60
:
ctrl_p
.
kill
()
sess
.
lock
.
release
()
return
ctrlsocket
...
...
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