Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
jflow
Commits
bcba1c2e
Commit
bcba1c2e
authored
Feb 17, 2016
by
Frédéric Escudié
Browse files
Manage error in preprocess.
Fix bug in workflow_status management.
parent
93d61151
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/jflow/workflow.py
View file @
bcba1c2e
...
...
@@ -580,7 +580,6 @@ class Workflow(threading.Thread):
last_stack_location
=
""
if
len
(
error
[
"traceback"
])
>
0
:
last_stack_location
=
error
[
"traceback"
][
-
1
][
"location"
].
strip
()
self
.
status
=
self
.
STATUS_FAILED
return
{
"msg"
:
error
[
"msg"
],
"location"
:
last_stack_location
}
else
:
return
None
...
...
@@ -819,7 +818,7 @@ class Workflow(threading.Thread):
"""
try
:
# if this is the first time the workflow run
if
self
.
__step
==
None
:
if
self
.
__step
==
None
:
self
.
start_time
=
time
.
time
()
self
.
__step
=
0
self
.
status
=
self
.
STATUS_STARTED
...
...
@@ -830,9 +829,15 @@ class Workflow(threading.Thread):
self
.
_serialize
()
# if pre_processing has not been done yet
if
self
.
__step
==
0
:
self
.
pre_process
()
self
.
__step
=
1
self
.
_serialize
()
try
:
self
.
pre_process
()
self
.
__step
=
1
except
:
self
.
status
=
self
.
STATUS_FAILED
self
.
end_time
=
time
.
time
()
raise
finally
:
self
.
_serialize
()
# if collecting components and running workflow has not been done yet
if
self
.
__step
==
1
:
try
:
...
...
@@ -840,8 +845,9 @@ class Workflow(threading.Thread):
self
.
components
=
[]
self
.
status
=
self
.
STATUS_STARTED
self
.
postprocess_status
=
self
.
STATUS_PENDING
self
.
_serialize
()
self
.
wf_execution_wrapper
()
except
SystemExit
:
except
:
self
.
status
=
self
.
STATUS_FAILED
self
.
end_time
=
time
.
time
()
self
.
_serialize
()
...
...
@@ -853,7 +859,7 @@ class Workflow(threading.Thread):
else
:
self
.
_execute_weaver
()
self
.
__step
=
3
self
.
_serialize
()
self
.
_serialize
()
# if the workflow was a dynamic one
if
self
.
__step
==
2
:
try
:
...
...
@@ -861,8 +867,9 @@ class Workflow(threading.Thread):
self
.
components
=
[]
self
.
status
=
self
.
STATUS_STARTED
self
.
postprocess_status
=
self
.
STATUS_PENDING
self
.
_serialize
()
self
.
wf_execution_wrapper
()
except
SystemExit
:
except
:
self
.
status
=
self
.
STATUS_FAILED
self
.
end_time
=
time
.
time
()
self
.
_serialize
()
...
...
@@ -892,8 +899,10 @@ class Workflow(threading.Thread):
utils
.
display_error_message
(
str
(
e
))
def
get_status
(
self
):
# first update the status from weaver folders
# TODO update self.end_time
"""
@summary: Update and return self.status.
@return: [STATUS] the workflow status.
"""
try
:
working_directory
=
os
.
path
.
join
(
self
.
directory
,
self
.
WORKING
)
make_states
=
[]
...
...
@@ -904,14 +913,12 @@ class Workflow(threading.Thread):
make_states
.
append
(
log
.
state
)
if
len
(
self
.
reseted_components
)
>
0
:
self
.
status
=
self
.
STATUS_RESETED
elif
self
.
STATUS_ABORTED
in
make_states
:
elif
self
.
STATUS_ABORTED
in
make_states
:
# Error in component execution
self
.
status
=
self
.
STATUS_ABORTED
elif
self
.
STATUS_FAILED
in
make_states
:
elif
self
.
STATUS_FAILED
in
make_states
:
# Error in component execution
self
.
status
=
self
.
STATUS_FAILED
elif
self
.
postprocess_status
==
self
.
STATUS_FAILED
:
elif
self
.
postprocess_status
==
self
.
STATUS_FAILED
:
# Error in postprocess
self
.
status
=
self
.
STATUS_FAILED
elif
self
.
status
!=
self
.
STATUS_COMPLETED
:
self
.
status
=
self
.
STATUS_STARTED
except
:
pass
return
self
.
status
...
...
src/jflow/workflows_manager.py
View file @
bcba1c2e
...
...
@@ -100,6 +100,8 @@ class WorkflowsManager(object):
workflow
=
self
.
get_workflow
(
workflow_id
)
if
hasattr
(
workflow
,
"stderr"
):
workflow
.
_set_stderr
()
workflow
.
status
=
workflow
.
STATUS_STARTED
workflow
.
postprocess_status
=
workflow
.
STATUS_PENDING
workflow
.
start
()
# Update the workflow in the cache
self
.
_dump_workflows
([
workflow
])
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment