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
8f00293e
Commit
8f00293e
authored
Oct 16, 2012
by
Leo Gordon
Browse files
try not to shock the Q::register_worker_death() code with inexistent W->analysis_id
parent
24fdc833
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
29 deletions
+31
-29
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+30
-28
scripts/beekeeper.pl
scripts/beekeeper.pl
+1
-1
No files found.
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
8f00293e
...
...
@@ -279,41 +279,43 @@ sub specialize_new_worker {
sub
register_worker_death
{
my
(
$self
,
$worker
)
=
@_
;
my
(
$self
,
$worker
)
=
@_
;
return
unless
(
$worker
);
return
unless
(
$worker
);
my
$cod
=
$worker
->
cause_of_death
()
||
'
UNKNOWN
';
# make sure we do not attempt to insert a void
my
$cod
=
$worker
->
cause_of_death
()
||
'
UNKNOWN
';
# make sure we do not attempt to insert a void
my
$sql
=
"
UPDATE worker SET died=CURRENT_TIMESTAMP, last_check_in=CURRENT_TIMESTAMP
";
$sql
.=
"
,status='DEAD'
";
$sql
.=
"
,work_done='
"
.
$worker
->
work_done
.
"
'
";
$sql
.=
"
,cause_of_death='
$cod
'
";
$sql
.=
"
WHERE worker_id='
"
.
$worker
->
dbID
.
"
'
";
my
$sql
=
qq{UPDATE worker SET died=CURRENT_TIMESTAMP
,last_check_in=CURRENT_TIMESTAMP
,status='DEAD'
,work_done='}
.
$worker
->
work_done
.
qq{'
,cause_of_death='$cod'
WHERE worker_id='}
.
$worker
->
dbID
.
qq{'}
;
$self
->
dbc
->
do
(
$sql
);
$self
->
dbc
->
do
(
$sql
);
if
(
my
$analysis_id
=
$worker
->
analysis_id
)
{
my
$analysis_stats_adaptor
=
$self
->
db
->
get_AnalysisStatsAdaptor
;
unless
(
$self
->
db
->
hive_use_triggers
()
)
{
$
worker
->
analysis
->
stats
->
adaptor
->
decrease_running_workers
(
$worker
->
analysis_id
);
}
unless
(
$self
->
db
->
hive_use_triggers
()
)
{
$analysis
_
stats
_
adaptor
->
decrease_running_workers
(
$worker
->
analysis_id
);
}
if
(
$cod
eq
'
NO_WORK
')
{
$self
->
db
->
get_AnalysisStatsAdaptor
->
update_status
(
$worker
->
analysis
->
dbID
,
'
ALL_CLAIMED
');
}
if
(
$cod
eq
'
UNKNOWN
'
or
$cod
eq
'
MEMLIMIT
'
or
$cod
eq
'
RUNLIMIT
'
or
$cod
eq
'
KILLED_BY_USER
')
{
$self
->
db
->
get_AnalysisJobAdaptor
->
release_undone_jobs_from_worker
(
$worker
);
}
# re-sync the analysis_stats when a worker dies as part of dynamic sync system
if
(
$self
->
safe_synchronize_AnalysisStats
(
$worker
->
analysis
->
stats
)
->
status
ne
'
DONE
')
{
# since I'm dying I should make sure there is someone to take my place after I'm gone ...
# above synch still sees me as a 'living worker' so I need to compensate for that
$self
->
db
->
get_AnalysisStatsAdaptor
->
increase_required_workers
(
$worker
->
analysis
->
dbID
);
}
if
(
$cod
eq
'
NO_WORK
')
{
$analysis_stats_adaptor
->
update_status
(
$worker
->
analysis_id
,
'
ALL_CLAIMED
');
}
elsif
(
$cod
eq
'
UNKNOWN
'
or
$cod
eq
'
MEMLIMIT
'
or
$cod
eq
'
RUNLIMIT
'
or
$cod
eq
'
KILLED_BY_USER
')
{
$self
->
db
->
get_AnalysisJobAdaptor
->
release_undone_jobs_from_worker
(
$worker
);
}
# re-sync the analysis_stats when a worker dies as part of dynamic sync system
if
(
$self
->
safe_synchronize_AnalysisStats
(
$worker
->
analysis
->
stats
)
->
status
ne
'
DONE
')
{
# since I'm dying I should make sure there is someone to take my place after I'm gone ...
# above synch still sees me as a 'living worker' so I need to compensate for that
$analysis_stats_adaptor
->
increase_required_workers
(
$worker
->
analysis_id
);
}
}
}
...
...
scripts/beekeeper.pl
View file @
8f00293e
...
...
@@ -213,7 +213,7 @@ sub main {
if
(
$meadow
->
check_worker_is_alive_and_mine
)
{
printf
("
Killing worker: %10d %35s %15s %20s(%d) :
",
$kill_worker
->
dbID
,
$kill_worker
->
host
,
$kill_worker
->
process_id
,
$kill_worker
->
analysis
->
logic_name
,
$kill_worker
->
analysis
->
dbID
);
$kill_worker
->
analysis
->
logic_name
,
$kill_worker
->
analysis
_id
);
$meadow
->
kill_worker
(
$kill_worker
);
$kill_worker
->
cause_of_death
('
KILLED_BY_USER
');
...
...
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