Closed khalo-sa closed 5 months ago
The _send_ping
task is not a background task. There is one of these per connected client. These tasks are short lived, they end on their own. It may take up to ping_interval
seconds for the task corresponding to a client to end gracefully from the time of disconnection.
Bug Description
Pretty much what the title says. I'm using python-socketio version 5.11.0.
Here is code to reproduce:
Output
Expected behavior I would expect sio_server.shutdown to clean up all python-socketio related background tasks. In that case, I'm wondering if the _ping task should have even be cancelled already after the user disconnected, since it is only created after the user connects.
Notes I only noticed this in the tests of a more complex project, where I always got annoying "task was destroyed but it is pending" warnings regarding the _ping coroutine, whenever the pytest fixture for the sio-server was torn down.