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
bob
gridtk
Commits
3b5942f7
Commit
3b5942f7
authored
Aug 27, 2013
by
Manuel Günther
Browse files
Fixed issue when job could not be started locally.
parent
4f6221ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
gridtk/local.py
View file @
3b5942f7
...
...
@@ -127,7 +127,9 @@ class JobManagerLocal(JobManager):
try
:
return
subprocess
.
Popen
(
command
,
env
=
environ
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
except
OSError
as
e
:
logger
.
error
(
"Could not execute job '%s' locally, reason:
\n\t
%s"
%
self
.
_format_log
(
job_id
,
array_id
),
e
)
job
=
self
.
get_jobs
((
job_id
,))[
0
]
logger
.
error
(
"Could not execute job '%s' locally,
\n
reason:
\t
%s,
\n
command_line
\t
%s:"
%
(
self
.
_format_log
(
job_id
,
array_id
),
e
,
job
.
get_command_line
()))
job
.
finish
(
117
,
array_id
)
# ASCII 'O'
return
None
...
...
@@ -181,6 +183,7 @@ class JobManagerLocal(JobManager):
for
task_index
in
range
(
len
(
running_tasks
)
-
1
,
-
1
,
-
1
):
task
=
running_tasks
[
task_index
]
process
=
task
[
0
]
if
process
.
poll
()
is
not
None
:
# process ended
job_id
=
task
[
1
]
...
...
@@ -217,6 +220,8 @@ class JobManagerLocal(JobManager):
array_job
=
queued_array_jobs
[
i
]
# start a new job from the array
process
=
self
.
_run_parallel_job
(
job
.
id
,
array_job
.
id
)
if
process
is
None
:
continue
running_tasks
.
append
((
process
,
job
.
id
,
array_job
.
id
))
# we here set the status to executing manually to avoid jobs to be run twice
# e.g., if the loop is executed while the asynchronous job did not start yet
...
...
@@ -228,6 +233,8 @@ class JobManagerLocal(JobManager):
if
job
.
status
==
'queued'
:
# start a new job
process
=
self
.
_run_parallel_job
(
job
.
id
)
if
process
is
None
:
continue
running_tasks
.
append
((
process
,
job
.
id
))
# we here set the status to executing manually to avoid jobs to be run twice
# e.g., if the loop is executed while the asynchronous job did not start yet
...
...
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