-
Notifications
You must be signed in to change notification settings - Fork 36
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
BUG: consumer_callbacks KeyError #132
Comments
File "/Users/miclon/myproject/use-py/use-rabbitmq/example/demo2.py", line 26, in start_consuming |
Interesting. I'll take a look, but a quick fix would be to have dedicated channel for each consumer, instead of sharing the same channel across multiple threads. |
When you have a chance can you take a look at this PR #134 |
Erik,A concern, but as I read this, if prefetch=1 and acknowledgments are required, the continue if there is no consumer tag will hang that process. Likewise, if acknowledgements are required it will hang at the point prefetch is exhausted with un-acked messages. JayOn Jul 12, 2024, at 5:20 AM, Erik Olof Gunnar Andersson ***@***.***> wrote:
When you have a chance can you take a look at this PR #134
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
The issue was a race condition where the code started consuming, and the other threads started pumping messages before the previous thread was done properly setting up the consumer. Since all of the IO happens asynchronously in the background and we were missing a lock protecting the setup phase. |
@eandersson Thanks! Solved the problem I was having very quickly, hopefully a new version will be released soon! |
Fix issue consuming on the same channel across threads [#132]
version: 2.10.7
I'm using the library in multithreading and I get the occasional
KeyError
.I replicated the problem after troubleshooting and minimal units.
I forked the project and tried to fix it. see commit
But I think there may be a more appropriate solution
The text was updated successfully, but these errors were encountered: