← Back to team overview

launchpad-dev team mailing list archive

Re: What is the state of celery in production?

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12-05-22 08:09 PM, Ian Booth wrote:
> I haven't landed any of my branches which introduce the new Celery
> jobs yet since I am waiting for Celery to be ready.

Only job classes that are mentioned in the
"jobs.celery.enabled_classes" feature flag will be run, so it is safe
to land your code.

> I think my basic implementation is ok based on the CeleryJobs wiki
> page and have unit tests using the CeleryLayer which seem to
> confirm this. But I am unsure what, if anything, I need to do with
> respect to error handling, retry on failure etc. Perhaps that is
> all done as part of the Celery framework? But then again, how would
> the framework know the difference between a fatal error that means
> the job must be aborted vs a transient error where the job can be
> retried. Are there any expected classes of exceptions one should
> raise in the run method which the framework relies on to determine
> how it should handle failure? Do I need to do anything to account
> for the job runner aborting half way through a job - will the job
> be automatically rerun?

The jobs code checks the retry_error_types member of your
BaseRunnableJob subclass, and if the exception matches one of those
classes, it retries the job until it hits max_retries.  If it hits
max_retries, it allows the exception to propagate.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+87bEACgkQ0F+nu1YWqI1ojwCbBDL5mikECmq9p6rAWOtbz1VW
NwgAmwUuHbtfPtdVj5BlM8M319q6V/aL
=25ux
-----END PGP SIGNATURE-----


Follow ups

References