-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add support for Celery >= 4.0 #69
Comments
Celery 4.0 has lots of good features that I'm excited about. We'd love to accept a pull request for Celery 4.0 support. If nobody is able to to contribute that PR soon, after the first of the year, PolicyStat will probably be able to dedicate some time to putting the PR together to make it happen. In the meantime, we're happy to accept PR's that make partial progress towards this goal, and we can use a Here's what I think we can do with 4.0 support: Make sure we support 3.1.25The first step to upgrading is supporting 3.1.25. Let's bump the requirement for the test suite and then fix all of the deprecation warnings. Drop support for Celery < 4.0 and bump to Jobtastic 2.0There are lots of backward compatibility hacks in the Jobtastic codebase that impede maintenance. Celery 4.0 adds several things that will greatly simplify the code base. Handling Task Connection ErrorsThe Move tests to pytextCelery 4.0 comes with lots of testing improvements. Lets move to pytest in order to take advantage of those. User decorator syntaxSubclassing is no longer the hotness, so we should use the decorators. DeprecationsThere are several deprecations that affect us. |
I'm already using Jobtasting on 3.1.25? It seems to work fine :) |
I have a PR up that handles quite a bit of the changes needed to support celery 4. The problem is, any test with a busted broker in celery 4 hangs. I don't know why. My suspicion is that celery 4 has done a lot of work to prevent broker exceptions from happening. I don't know for certain though. Once I figure that out, I don't think it'll be too difficult to getting tests passing with celery 3/4 support. |
Looks like we'll need to peg the version of kombu for celery 4.x |
I would love to see this merged, the dependency of celery 3 is going to bite me in the short run. If you need any help, please ring a bell. Thanks! |
Hello @gabn88 , I am actually in the process of getting my PR for basic celery 4 support code reviewed as we speak. I'm hoping to get a new version up on PyPi today if I can. |
That's great. I'll keep an eye on it. Thanks! |
Jobtastic 2.0.0 is on PyPi. It has celery 4.x support |
We have upgraded, but now it is not working anymore. Possible because the upgrade also installed the lastest kombu instead of 4.0.2. Will report back after downgrading that. |
On my development server the new jobtastic (2.0.0) with celery 4.2.1 and kombu 4.2.1 is working fine, however on my production server it is failing. 'Normal' celery tasks are working fine though. Cannot seem to find the issue, but the server runs out with Gateway timeout when the jobtastic job is planned... The task:
Called with:
The weird thing is that it is working fine on dev, but not on production. The broker is on an external server in production, but like I said it is working fine for regular celery tasks with the same settings. EDIT2: |
I tried again to use Jobtastic with celery 4.3 in production. In development everything works fine, but in production it fails. I have searched for a day for the issue now, and it seems that the apply_async method on the JobtasticTask is broken. It add an extra caching mechanism, so when the task is executed once, it cannot be executed anymore (even not with different kwargs). Edit: The problem seems to be that in development I have only one (local) cache. In production I have a cache on the webserver and a seperate cache on the worker. I use the cache on the worker as CELERY_RESULT_BACKEND. But only when I clear the (local) cache on the webserver I can do tasks again. Edit2: Fixed it by explicitly defining the CELERY_RESULT_BACKEND as a cache on Django, a.k.:
and adding also in the settings:
After restarting the worker and the apache server (I had to stop it and start it again, a restart was not working) it is working! :) |
The text was updated successfully, but these errors were encountered: