New RunLLM response generated: >>>*# Question* Hi...
# runllm-flyte-trial
j
New RunLLM response generated: >>>*# Question* Hi team, Task retries don’t seem to work any more…? Flytekit: 1.13.3 Backend: 1.13 If the url fails for some reason, I don’t see the task actually retrying. I can obviously add http retries as a mitigation but curious why task retries are not working?
Copy code
@task(retries=5)
def get_some_data_from_http() -> List[str]:

    edit_map_versions = set()
    signed_off_maps = set()
    response = requests.get("my url", timeout=20)
    if response.status_code != HTTPStatus.OK:
        raise Exception("Failed to retrieve data")
    # Process and return data....
# Answer Flyte retries tasks based on the type of error encountered. According to Flyte documentation, Flyte distinguishes between system errors and user errors. System errors, such as network issues, are typically retried automatically. However, user errors, which include exceptions raised in user-defined code, are not retried unless they are subclasses of
FlyteRecoverableException
. In your case, the exception raised when the HTTP request fails is a generic exception, which Flyte treats as a non-recoverable user error. To enable retries, you should raise a
FlyteRecoverableException
instead. Would you like more detail on how to implement this change? Sources: - Flyte documentation on retries Slack Link https://.slack.com/archives/CP2HDHKE1/p1731626545.748649 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.