You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a server code that connects clients though WebSockets. The server that I coded calls the close all Websockets connected (maintained in a set as the documentation recommends), and I expect the code calls the close() method of the websocket as many time as web sockets are connected.
Actual behaviour
Right now, there is only one close being called. After the first call, it is like the server continues executing the rest of the shutdown processing.
Steps to reproduce
Start the server with python server.py
Start two clients with with python client.py
Ctrl-C on the sever and you only see one print with the label closing websocket
GitMate.io thinks the contributor most likely able to help you is @asvetlov.
Possibly related issues are #194 (websockets), #301 (Secure Websockets?), #691 (Websockets are automatically closed after response), #754 (How to close websockets coroutines ?), and #753 (Websockets in variables).
Hello I saw all the possible related issues and none one applies. The closest is issue 754 and it talks about how to close the client websocket connection. My case applies for web sockets closed by server request.
Hello, @lmarent, there has been no activity here for the last 3 years, can you confirm that this is still a problem? Also I've reviewed your code and suggest that you consider using asyncio.wait_for() or asyncio.sleep(0) in the on_shutdown() function for better handling of program shutdown. These functions may help ensure that all connections are properly closed before the program terminates.
Activity
aio-libs-bot commentedon Jan 17, 2019
GitMate.io thinks the contributor most likely able to help you is @asvetlov.
Possibly related issues are #194 (websockets), #301 (Secure Websockets?), #691 (Websockets are automatically closed after response), #754 (How to close websockets coroutines ?), and #753 (Websockets in variables).
lmarent commentedon Jan 22, 2019
Hello I saw all the possible related issues and none one applies. The closest is issue 754 and it talks about how to close the client websocket connection. My case applies for web sockets closed by server request.
fix aiohttp hang when disconnectinf ws clients
fix aiohttp hang when disconnectinf ws clients
dzhalaevd commentedon Apr 30, 2023
Hello, @lmarent, there has been no activity here for the last 3 years, can you confirm that this is still a problem? Also I've reviewed your code and suggest that you consider using
asyncio.wait_for()orasyncio.sleep(0)in theon_shutdown()function for better handling of program shutdown. These functions may help ensure that all connections are properly closed before the program terminates.Bump urllib3 from 2.3.0 to 2.4.0 (#10715)
Bump urllib3 from 2.3.0 to 2.4.0 (#10717)