-
Notifications
You must be signed in to change notification settings - Fork 308
Queue auto deletion is not reflected in internal entity cache #579
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
Comments
I'm afraid Bunny cannot possibly know if a queue was autodeleted as it cannot track its consumers that may be coming from other connections. |
This is also the case for RabbitMQ Java client, for example: it will try to invalidate known "cache" entries that are auto-delete but it is only able to do so for queues and consumers managed on a single connection (it used to be a channel). There is no way a connection can know what's happening to consumers on other connections or in other processes. Consider not sharing auto-delete queues or using passive declares where appropriate. No sharing means no queue "state" incoherencies. |
Hi @michaelklishin i am using a single connection, and just deleting the single consumer of an auto delete queue. The server then deletes the queue but i couldn't seem to find anywhere in the code of |
As I explained above, Bunny cannot really get much insight into those events. It only has a chance to "correct" such discrepancies during connection recovery. RabbitMQ Java client is the most advanced in this area: it invalidates entries in its cache of known entities based on some of their AutorecoveringConnection and AutorecoveringChannel demonstrate the idea. Bunny could do something similar and the cache can be connection-wide (it is per-channel). |
I'd consider a PR that adds an option that bypasses the cache for |
Ok I understand. I was under the impression that |
If a queue is auto deleted (a queue declared with
auto_delete => true
) it is still kept in the cache of ruby bunnyBunny::Channel#queues
This can cause an exception leading to the channel being closed(
channel error: NOT_FOUND
) when the queue gets deleted by the server by removing it's consumers, redeclared(queue is not recreated in the server) and then rebounded.The text was updated successfully, but these errors were encountered: