Avi A
06/04/2020, 9:18 AMtimeout
argument. This causes all tasks of this type to not report their completion! I see on the agent itself that their execution is done, but there’s no call to the state handler to change state to complete, or to write the task result, as is normally the case with the tasks.
Here’s the gist of my task definition; when I remove the line setting kwargs['timeout']
everything works.
TIMEOUT = 10. # minutes
class MyTask(Task):
def __init__(
self,
param1 = None,
param2 = None,
cache: bool = False,
**kwargs
):
self.cache = cache
if 'max_retries' not in kwargs and 'retry_delay' not in kwargs:
kwargs['max_retries'] = DEFAULT_MAX_RETRIES
kwargs['retry_delay'] = timedelta(minutes=DEFAULT_RETRY_DELAY)
kwargs['timeout'] = TIMEOUT * 60 # If I remove this line, everything works great
super().__init__(**kwargs)
def run(self, param1=None, param2=None):
# Code!
I fear it’s a bug in prefect but not sure. Would love to get some input before I open an issueLaura Lorenz (she/her)
06/04/2020, 1:30 PMAvi A
06/04/2020, 1:33 PMAvi A
06/04/2020, 1:35 PMLaura Lorenz (she/her)
06/04/2020, 1:37 PMAvi A
06/04/2020, 1:47 PMRemoteEnvironment(executor="prefect.engine.executors.LocalDaskExecutor")
Laura Lorenz (she/her)
06/04/2020, 1:49 PMtimeout
kwarg. I’ll make sure to follow up on that side of things too as that project is going on 🙂Avi A
06/04/2020, 1:53 PMtimeout
might come at almost zero cost. But I want to stress that this feature is not that crucial for me, I used it b/c I thought it was there, and didn’t realize it would cause problems with log reporting. I think that documenting the caveats is a good solution for the time being.Laura Lorenz (she/her)
06/04/2020, 1:55 PM