Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Expected errors #300

Closed
takhs91 opened this issue Apr 3, 2020 · 2 comments
Closed

Feature Request: Expected errors #300

takhs91 opened this issue Apr 3, 2020 · 2 comments
Milestone

Comments

@takhs91
Copy link
Contributor

takhs91 commented Apr 3, 2020

I would like to propose adding one more useful feature that we currently use in celery and will help us finish our migration in a straightforward way.

That is of giving the option to pass to the actor a list of exceptions for which:

  • No retries will occur
  • the exception will be normally stored in the results backend so the caller can get the resulting error.
  • Doesn't log the event as error but as info level.

This is actually the equivalent of https://docs.celeryproject.org/en/stable/userguide/tasks.html#Task.throws

This is very fitting for use cases where tasks use parameters or data provided by users, for combinations of whom the task may fail in expected ways (that you can't know itwill happen before running it).

In such cases there is no way this may succeed by retrying, there is no value in polluting your sentry/logs with error level info, and you want the caller side to be able to get the resulting error of this task so it can return the appropriate error response.

This also applies to other types of expected errors.

@Bogdanp whould you integrate this feature? I can work on the implementation and provide a PR

@Bogdanp
Copy link
Owner

Bogdanp commented Apr 4, 2020

Yes, feel free to work on this. I'd probably just update Retries to recognize a throws option and avoid making changes to the logging since that part of the code won't have full access to those options.

@Bogdanp
Copy link
Owner

Bogdanp commented May 10, 2020

I'm closing this since the feature has been merged.

@Bogdanp Bogdanp closed this as completed May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants