aiormq icon indicating copy to clipboard operation
aiormq copied to clipboard

[fix] wait for inner tasks before closing #70

Open moznuy opened this issue 5 years ago • 4 comments

Probably fixes #70

moznuy avatar Feb 21 '20 14:02 moznuy

OK, it does not fix the problem, because https://github.com/mosquito/aiormq/blob/bedf52cee682777435c71486e1614636aedc9330/aiormq/channel.py#L80 is also in the inner tasks that are cancelled by reversing order. Maybe it is possible to separate __reader and the rest of tasks

moznuy avatar Feb 21 '20 14:02 moznuy

And now I think this is not worth it... Maybe we can just ignore all messages after channel.close() with some flag

moznuy avatar Feb 21 '20 16:02 moznuy

Also need to write test case for #70 :smile:

moznuy avatar Feb 21 '20 16:02 moznuy

OK, it failed due to

tests/test_connection.py::test_no_free_channels[amqp-uvloop]

Task exception was never retrieved
future: <Task finished name='Task-15309' 
coro=<Connection.channel() done, 
defined at /drone/src/aiormq/connection.py:474> 
exception=<ConnectionNotAllowed: 
The client tried to work with some entity in a manner that is 
prohibited by the server, due to security settings or 
by some other criteria: 'NOT_ALLOWED - number of 
channels opened (2047) has reached the negotiated 
channel_max (2047)'> created at /usr/lib/python3.8/asyncio/tasks.py:470
>

I see @pytest.mark.no_catch_loop_exceptions there and I don't know what it is, but it passes this test in all environments on my machine.

moznuy avatar Feb 21 '20 23:02 moznuy

@moznuy is it still actual? It looks like this problem has already been solved in master, albeit in a different way.

mosquito avatar Dec 15 '22 13:12 mosquito