If a Service class exposes an API that calls self.manager.run_task the call will fail.
class MyService(Service):
def schedule_thing(self):
self.manager.run_task(self.do_thing)
This is because there is a check that the current task is part of the set of tasks which are already known to the service. In the above example, the current task will be external to the service and should not be cancelled upon service cancellation.
How can it be fixed.
I think that it makes the most sense to place these tasks in a separate container since they are detattched from the task DAG. I think it's appropriate to treat them as new root nodes in the DAG.
What is wrong
If a
Service
class exposes an API that callsself.manager.run_task
the call will fail.This is because there is a check that the current task is part of the set of tasks which are already known to the service. In the above example, the current task will be external to the service and should not be cancelled upon service cancellation.
How can it be fixed.
I think that it makes the most sense to place these tasks in a separate container since they are detattched from the task DAG. I think it's appropriate to treat them as new root nodes in the DAG.