Commit 91de34e4 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

bugfix: jobs could not trigger MEMLIMIT events

(and probably RUNLIMIT as well)
The problem was in Queen::register_worker_death(). The code fetches the
current role, finalizes it, and then updates the worker table. The role
that is fetched from the database with fetch_last_unfinished_by_worker_id()
is not connected to any workers and later, when
AnalysisJobAdaptor::release_undone_jobs_from_role() needs to know the cause
of death and the number of work done by the worker, the role would load
another instance of the worker using the information currently stored in
the database, that is: before it has been updated.
Hence, the code was complaining that cause_of_death was not populated.
By associating the role to the worker, we allow the method to read the
existing information
parent 1c4579c9
......@@ -333,6 +333,7 @@ sub register_worker_death {
if( $current_role and !$current_role->when_finished() ) {
$current_role->worker($worker); # So that release_undone_jobs_from_role() has the correct cause_of_death and work_done
$current_role->when_finished( $worker_died );
$self->db->get_RoleAdaptor->finalize_role( $current_role, $self_burial );
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment