Kevin Weiler
09/24/2021, 2:14 PMstate_handler
? It’s sort of surprising to me that, for example, the kubernetes RunNamespaceJob
doesn’t seem to include any logic around this (https://github.com/PrefectHQ/prefect/blob/master/src/prefect/tasks/kubernetes/job.py#L580).Kevin Kho
Kevin Weiler
09/24/2021, 2:23 PMKevin Weiler
09/24/2021, 2:24 PMKevin Kho
RunNamespaceJob
, I have seen people have difficulty with passing the pod
details or job
details out to that they can shut it down in the state handler.
I think if it fails, you are right that the state handler is a good approach if you can get the necessary info in there.Kevin Weiler
09/24/2021, 2:30 PMstate_handler
bit then. Seems to me that the Task
metaclass should have a method stub like:
def do_this_on_cancel():
...
def do_this_on_fail():
...
But I’m no developer…Kevin Kho
def mystatehandler(task,old_state,new_state):
if new_state.is_failed():
# logic
Kevin Kho