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
Switch between thread & global for app.backend #7961
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
Codecov ReportBase: 90.15% // Head: 90.14% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #7961 +/- ##
==========================================
- Coverage 90.15% 90.14% -0.01%
==========================================
Files 138 138
Lines 17091 17104 +13
Branches 2312 2712 +400
==========================================
+ Hits 15408 15419 +11
- Misses 1430 1431 +1
- Partials 253 254 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
celery/app/base.py
Outdated
@@ -1,5 +1,6 @@ | |||
"""Actual App instance implementation.""" | |||
import inspect | |||
import multiprocessing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as celery use billiard which is a fork of multiprocessing,, should we use multiprocessing here? can multiprocessing.current_process() imported from billiard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not realize it was a thing, will switch to billiard
Meanwhile fixed flake8 (cannot open another fork atm, committed here) PyCQA/flake8#1689
Not sure if the the failure is related |
Hmmm will have to look into this during the weekends.. Getting timeouts left right and center with only Redis, seems suspicious |
Interestingly they do pass when run locally:
Also re-tested with https://github.com/chenseanxy/celery-eventlet-backend-imports using eventlet, prefork and threads, all cases seem to be fine & fixed (backend only created once)
Wondering if it's some kind of issue with redis broker's setup in CI |
I'm 99.9% positive this has nothing to do with this PR. @chenseanxy |
we need to have input from more team members. so lets wait until next week |
@@ -1249,14 +1252,32 @@ def amqp(self): | |||
"""AMQP related functionality: :class:`~@amqp`.""" | |||
return instantiate(self.amqp_cls, app=self) | |||
|
|||
def inform_green(self, is_green): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a show-blocker, but I'd recommend adding a small unit test according to the code coverage warning
I agree. Added @thedrow as a reviewer. Also reviewed it myself and to my understanding it looks good. @chenseanxy Your confirmation for the validity of the change is https://github.com/chenseanxy/celery-eventlet-backend-imports, correct? |
Changed my mind, all of the P.S |
I see different tests failing. |
can we get #7974 merge first and pull here to recheck the failing integration tests? btw what does rabbitmq_redis does different? |
@chenseanxy The PR #7974 is merged. Please rebase to include the fixes @auvipy added and lets see if this PR goes green :) |
Note: Before submitting this pull request, please review our contributing
guidelines.
Description
For app.backend, switch between self._local and self._global as cache, depending
on whether the environment is fully thread-safe (eg. eventlet), and whether the
backend is thread-safe (eg. Redis)
Fixes: