-
Notifications
You must be signed in to change notification settings - Fork 198
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
Robust_connection and RuntimeError "Writer is None" #288
Comments
I'm also getting |
|
Any update on this issue? |
@nhumrich unfortunately not, too much have to be investigated. |
@mosquito So, I tracked this down to being an issue with the RobustChannel not actually being robust. When a channel dies, you can call You can reproduce by creating a channel, then doing something that will close the channel such as binding a queue that doesn't exist to an exchange. |
Just for records I experienced this when due to a failure in my program I did not acked a message. 30 minutes after that I could see this in RabbitMQ:
And then I got this exception
I "fixed" it by acking all messages, but the problem there still remains. |
I am encountering the same situation. Minimal reproduction: import contextlib
import aio_pika
connection = await aio_pika.connect_robust(url)
exit_stack = contextlib.AsyncExitStack()
await exit_stack.enter_async_context(connection)
channel = await connection.channel()
await channel.declare_queue(subject_that_exists, passive=True) # works fine
await channel.declare_queue(subject_that_doesnt_exist, passive=True) # raises aiormq.exceptions.ChannelNotFoundEntity
await channel.declare_queue(subject_that_exists, passive=True) # raises aiormq.exceptions.ChannelInvalidStateError: writer is None
await channel.reopen()
await channel.declare_queue(subject_that_exists, passive=True) # works fine |
@kaya-zekioglu that's a good example but this doesn't reproduce that issue. As in the topic described this issue raises when reconnection performs. Of course, I can rewrite it for calls reopen when the channel is closed for any reason, but it's might have unexpected side effects. |
@mosquito How about you make it optional? |
@themanifold I think it's the wrong way to done it. |
Thank you for the explanation. I understand now that what I encountered is not necessarily related to this issue. |
Hello. I have the same issue. But, my consumer starts with the no_ack flag. In spite of this, I get 'operation none caused a channel exception precondition_failed: delivery acknowledgement on channel 1 timed out.' Then channel is closed. |
Is it safe to have different consumers (with different queueus ) on the same channel? |
@bokolob yes it's Sorry guys it's really giant work that I will have to be done. Unfortunately, work and private life takes up more time than we would like, there is not much free time left, especially for such big changes as in #381. |
aio-pika 7.0 may address an important issue concerning the `robust_connection`. mosquito/aio-pika#288
Is it ok that
robust_connection
with argsreconnection_interval=0.5
andtimeout=2
throws exception when connection couldn't be re-established duringexchange.publish(Message(...))
?When I use just a Connecton class and wrap connection with:
I see no exceptions during code execution. I use this to reconnect to server if connection was lost during message sending. I know that I've reinvented a wheel, but it works as I expected.
The text was updated successfully, but these errors were encountered: