Skip to content

Asyncio error and close timeout on ping abort when closing connection #669

@BenjaminHamon

Description

@BenjaminHamon

Using websockets 8.0.2, python 3.7.2 on Windows 7.

When sending a ping over a closing connection, the ping gets aborted. On the sender side, asyncio logs an error Future exception was never retrieved for ConnectionClosedOK. On the receiver side, the connection is lost with code 1006 and returns after some time, which appears to be a close timeout.

Waiting for the pong appears to fix the asyncio error, but the websockets documentation states waiting for the pong is optional.

See the logs and test scripts in websocket_test.zip

I am assuming this is related to issue #551?

For context, this appears to be the cause for rare failures (1 out of ~50 runs) for a test case I have for disconnection, because I check logs for errors and expects connect to return in a short timespan after the connection closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions