Skip to content
  • Matthieu Muffato's avatar
    bugfix: jobs could not trigger MEMLIMIT events · 91de34e4
    Matthieu Muffato authored
    (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
    91de34e4