-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Fix: serialization error when gossip working #6566
Fix: serialization error when gossip working #6566
Conversation
@@ -176,6 +176,7 @@ def get_consumers(self, channel): | |||
channel, | |||
queues=[ev.queue], | |||
on_message=partial(self.on_message, ev.event_from_message), | |||
accept=ev.accept, |
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.
hey, thanks for the PR, but this change needs some unit test to get accepted
can you at least add a unit test for this fix? |
@auvipy |
you can take your time, I have other priorities todo in celery at the moment |
@kitsuyui Is there a chance that you'll complete this PR soon? |
@thedrow No. |
Any news on this? As the author said he can't finish is it possible some celery mantainer pick it up, please? cc @auvipy This is affecting us greatly with no other fix or workaround |
We need to verify this is working and not creating any regression. Thanks for the ping |
I encountered this issue too and solved by adding |
hey! great to know that. is it possible for you to send a PR to improve the docs regarding the issue/solution you mentioned? |
Based on what I've seen, I don't see how this could fix the problem since the problem is that gossip doesn't respect these settings. I'm pretty sure this PR is the correct solution based on a frustrating encounter with this issue today. Is there any chance we could merge this as-is and file a follow-up for a unit test? This is a pretty bad bug: it will affect anyone still using pickle serialization with gossip. |
problem is the patch is making the CI red. which means it will create regression |
Hi, sorry for being vague. Sorry for the long delay. I have quitted the company that required this patch. However, I now have time to develop it. If there is anything I can do to help, I would like to do so. I have already found a way to reproduce the problem at #5075 (comment), so I could try again. The problem was that I was not able to write the necessary tests well, and I was unable to eliminate concerns about regression. I may still need someone's help in this. |
1a18671
to
c8f286b
Compare
thanks for coming back! as you shared in your repo kitsuyui#5 (comment) some changes on these tests would be needed. I currently have a big backlog in celery to clear. so in the mean time if you can try to figure out some sort of test, it would be great |
c8f286b
to
55574dc
Compare
@auvipy Hi. I have updated the commits and description of the pull request. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6566 +/- ##
=======================================
Coverage 87.33% 87.33%
=======================================
Files 148 148
Lines 18515 18515
Branches 3163 3163
=======================================
Hits 16170 16170
Misses 2060 2060
Partials 285 285
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
thanks for the tests! the failures seems to be github network related. so going to re start the CI |
@auvipy Hi, I can't rerun CI because I don't have permissions on the project. Please retry. ☕ |
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.
please pull from main branch again
Pass accept when Gossip getting consumers.
If event_serializer, result_serializer, accept_content are set correctly, it works normally. Otherwise, an error is output to the log. Test that.
55574dc
to
53ea3f3
Compare
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.
looks good to me
Fix of #5075
Current problem
Currently, Gossip does not respect accept_content when generating a consumer.
If you have multiple Celery workers running and allow pickle with accept_content, you may get a
Refusing to deserialize disabled content of type pickle (application/x-python-serialize)
error.This error does not occur when running a single worker, but it does occur when running multiple workers.
What this PR does
Refusing to deserialize disabled content of type
are occurringAdditional notes
Some of the existing unit tests use
Mock()
to replace Gossip processing. This is the case witht/unit/worker/test_consumer.py
.Mock()
needs to be configured with additional settings to work as intended with this change.Some of the tests are unstable. I (@kitsuyui) have confirmed that these failures occur without my changes.