Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
26f27a0f
Commit
26f27a0f
authored
Aug 13, 2010
by
Leo Gordon
Browse files
let jobs decide whether it makes any sense to restart them or not
parent
a76de6b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
modules/Bio/EnsEMBL/Hive/AnalysisJob.pm
modules/Bio/EnsEMBL/Hive/AnalysisJob.pm
+14
-0
modules/Bio/EnsEMBL/Hive/Worker.pm
modules/Bio/EnsEMBL/Hive/Worker.pm
+5
-1
No files found.
modules/Bio/EnsEMBL/Hive/AnalysisJob.pm
View file @
26f27a0f
...
...
@@ -139,6 +139,8 @@ sub stderr_file {
return
$self
->
{'
_stderr_file
'};
}
##-----------------[indicators to the Worker]--------------------------------
sub
lethal_for_worker
{
# Job should set this to 1 prior to dying (or before running code that might cause death - such as RunnableDB's compilation)
# if it believes that the state of things will not allow the Worker to continue normally.
# The Worker will check the flag and commit suicide if it is set to true.
...
...
@@ -147,6 +149,18 @@ sub lethal_for_worker { # Job should set this to 1 prior to dying (or before
return
$self
->
{'
_lethal_for_worker
'};
}
sub
transient_error
{
# Job should set this to 1 prior to dying (or before running code that might cause death)
# if it believes that it makes sense to retry the same job without any changes.
# It may also set it to 0 prior to dying (or before running code that might cause death)
# if it believes that there is no point in re-trying (say, if the parameters are wrong).
# The Worker will check the flag and make necessary adjustments to the database state.
my
$self
=
shift
;
$self
->
{'
_transient_error
'}
=
shift
if
(
@
_
);
return
$self
->
{'
_transient_error
'};
}
##-----------------[/indicators to the Worker]-------------------------------
sub
print_job
{
my
$self
=
shift
;
my
$logic_name
=
$self
->
adaptor
()
...
...
modules/Bio/EnsEMBL/Hive/Worker.pm
View file @
26f27a0f
...
...
@@ -515,7 +515,11 @@ sub run
my
$job_status_when_died
=
$job
->
status
();
warn
"
Job with id=
$job_id
died in status '
$job_status_when_died
' for the following reason:
$error_msg
\n
";
$self
->
db
()
->
get_JobErrorAdaptor
()
->
register_error
(
$job_id
,
$error_msg
);
$job
->
update_status
('
FAILED
');
if
(
$job
->
transient_error
)
{
$job
->
adaptor
->
reset_dead_job_by_dbID
(
$job_id
);
}
else
{
$job
->
update_status
('
FAILED
');
}
if
(
$job
->
lethal_for_worker
)
{
# either a compilation error or other job-sanctioned contamination
warn
"
Job's error has contaminated the Worker, so the Worker will now die
\n
";
...
...
Write
Preview
Markdown
is supported
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