Skip to content

websockets close unexpected behavior #3550

@lmarent

Description

@lmarent

Long story short

unexpected processing during shutdown

Expected behaviour

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

Your environment

OS: UBUNTU 16.04
Python: 3.6

Libraries Installed
aiohttp==3.5.1
async-timeout==3.0.1
attrs==18.2.0
chardet==3.0.4
idna==2.8
idna-ssl==1.1.0
multidict==4.5.2
typing-extensions==3.6.6
yarl==1.3.0

files.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Staleneeds-infoIssue is lacking sufficient information and will be closed if not provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions