Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Felix Seibert
xtreemfs_client
Commits
64fddaee
Commit
64fddaee
authored
Mar 22, 2018
by
Felix Seibert
Browse files
clarifying name, timeout in catch block
parent
ba68860c
Changes
1
Hide whitespace changes
Inline
Side-by-side
xtreemfs_client/div_util.py
View file @
64fddaee
...
...
@@ -87,22 +87,22 @@ def run_commands(commands, max_processes=200, print_errors=True):
del
running_processes_map
[
finished_process
]
# for finished_process in running_processes:
for
finished
_process
in
running_processes_map
:
for
still_running
_process
in
running_processes_map
:
try
:
stdout
,
stderr
=
finished
_process
.
communicate
(
timeout
=
10
)
stdout
,
stderr
=
still_running
_process
.
communicate
(
timeout
=
10
)
except
subprocess
.
TimeoutExpired
:
print
(
"process timed out: "
+
str
(
finished
_process
.
args
))
finished
_process
.
kill
()
print
(
"process timed out: "
+
str
(
still_running
_process
.
args
))
still_running
_process
.
kill
()
print
(
"process killed."
)
stdout
,
stderr
=
finished
_process
.
communicate
()
stdout
,
stderr
=
still_running
_process
.
communicate
(
timeout
=
10
)
finished_process
=
(
finished
_process
.
args
,
still_running_process
=
(
still_running
_process
.
args
,
(
stdout
,
stderr
),
finished
_process
.
returncode
)
if
finished
_process
[
2
]
!=
0
:
errored_processes
.
append
(
finished
_process
)
still_running
_process
.
returncode
)
if
still_running
_process
[
2
]
!=
0
:
errored_processes
.
append
(
still_running
_process
)
if
print_errors
:
print_error
(
finished
_process
)
print_error
(
still_running
_process
)
num_finished
+=
1
print
(
"progress: "
+
str
(
num_finished
)
+
"/"
+
str
(
num_total
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment