Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl-hive
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl-hive
Commits
8fdee647
Commit
8fdee647
authored
14 years ago
by
Leo Gordon
Browse files
Options
Downloads
Patches
Plain Diff
gc_dataflow at last?
parent
85b961a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
+32
-14
32 additions, 14 deletions
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
with
32 additions
and
14 deletions
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
+
32
−
14
View file @
8fdee647
...
...
@@ -394,14 +394,19 @@ sub update_status {
my
(
$self
,
$job
)
=
@_
;
my
$sql
=
"
UPDATE analysis_job SET status='
"
.
$job
->
status
.
"
'
";
if
(
$job
->
status
eq
'
DONE
')
{
$sql
.=
"
,completed=now()
";
$sql
.=
"
,runtime_msec=
"
.
$job
->
runtime_msec
;
$sql
.=
"
,query_count=
"
.
$job
->
query_count
;
}
if
(
$job
->
status
eq
'
READY
')
{
}
els
if
(
$job
->
status
eq
'
READY
')
{
$sql
.=
"
,job_claim=''
";
}
elsif
(
$job
->
status
eq
'
PASSED_ON
')
{
$sql
.=
"
,job_claim='', completed=now()
";
}
$sql
.=
"
WHERE analysis_job_id='
"
.
$job
->
dbID
.
"
'
";
my
$sth
=
$self
->
prepare
(
$sql
);
...
...
@@ -555,8 +560,14 @@ sub release_undone_jobs_from_worker {
my
$passed_on
=
0
;
# the flag indicating that the garbage_collection was attempted and was successful
if
(
$resource_overusage
)
{
$passed_on
=
$self
->
gc_dataflow
(
$job_id
,
$cod
);
if
(
$resource_overusage
)
{
my
$branch_code
=
{
'
MEMLIMIT
'
=>
'
-1
',
'
RUNLIMIT
'
=>
'
-2
',
}
->
{
$cod
};
$passed_on
=
$self
->
gc_dataflow
(
$worker
->
analysis
->
dbID
(),
$job_id
,
$branch_code
);
}
unless
(
$passed_on
)
{
...
...
@@ -580,22 +591,29 @@ sub release_and_age_job {
}
);
}
=head2 gc_dataflow (stub)
0) check if there is a dataflow rule that corresponds to this $cod, return 0 if not
=head2 gc_dataflow
1) perform a 'limited responsibility' dataflow
2) set the given job's status to 'PASSED_ON'
3) record the fact of the dataflow in job_message table
4) return 1 if gc_dataflow succeeded, 0 otherwise
Description: perform automatic dataflow from a dead job that overused resources if a corresponding dataflow rule was provided
Should only be called once during garbage collection phase, when the job is definitely 'abandoned' and not being worked on.
=cut
sub
gc_dataflow
{
my
(
$self
,
$job_id
,
$cod
)
=
@_
;
my
(
$self
,
$analysis_id
,
$job_id
,
$branch_code
)
=
@_
;
unless
(
@
{
$self
->
adaptor
->
db
->
get_DataflowRuleAdaptor
->
fetch_from_analysis_id_branch_code
(
$analysis_id
,
$branch_code
)
})
{
return
0
;
# no corresponding gc_dataflow rule has been defined
}
my
$job
=
$self
->
fetch_by_dbID
(
$job_id
);
return
0
;
$job
->
param_init
(
0
,
$job
->
input_id
()
);
# input_id_templates still supported, however to a limited extent
$job
->
dataflow_output_id
(
$job
->
input_id
()
,
$branch_code
);
$job
->
update_status
('
PASSED_ON
');
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment