Skip to content

Migrate ensure_computing transitions to new WorkerState event mechanism #5895

@fjetter

Description

@fjetter

The task executing transitions should be migrated to the WorkerState event mechanism as outlined in #5736 (comment)

  • The Worker.execute method is modified such that it no longer performs any transition but instead returns appropriate StateMachineEvents that trigger the necessary handlers. For instance
    • TaskFinished
    • Rescheduled
    • TaskErred
  • The ensure_computing method is removed from the list of handle_comm every_cycle callbacks
  • The logic of ensure_computing is moved to a private method (perspectively a method of the new class WorkerState)
  • The new private method will not perform any transitions but rather return a list of recommendations
  • This private method is then called as part of the transition system, e.g.
    • unpause handler
    • transition_waiting_ready
    • transition_executing_*
  • The implicit goal is to remove all invocations of self.loop.add_callback(self.execute, ...) and replace this with the new callback method

Blocked by

Related work

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions