I use on_error parameter of aioamqp.connect to pass handler, which reestablish connection when it is accidentally closed. But it is called even after the channel is "legally" closed, which definitely is not an error case. And its exception argument looks weird: ChannelClosed(ChannelClosed(None, None), 'Channel is closed').
DEBUG:asyncio:Using selector: EpollSelector
INFO:aioamqp.protocol:Recv open ok
DEBUG:aioamqp.channel:Channel is open
INFO:__main__:Close channel
INFO:aioamqp.channel:Channel closed
INFO:__main__:Close protocol
INFO:aioamqp.protocol:Recv close ok
INFO:__main__:Close transport
WARNING:aioamqp.protocol:Connection lost exc=None
ERROR:__main__:Handle error ChannelClosed(ChannelClosed(None, None), 'Channel is closed')
I use
on_error
parameter ofaioamqp.connect
to pass handler, which reestablish connection when it is accidentally closed. But it is called even after the channel is "legally" closed, which definitely is not an error case. And itsexception
argument looks weird:ChannelClosed(ChannelClosed(None, None), 'Channel is closed')
.Here is the code to reproduce the issue:
Here is its output:
Environment: