Skip to content

async for message in self.websocket: blocks the event loop #1619

@mmertc

Description

@mmertc

Hello,

I'm developing a trading application and the problem I'm currently experiencing is that after running without a problem for a while, sending and receiving lots of messages successfully, the event loop gets stuck on a line with "async for message in self.websocket". I only see this is the case when I KeyboardInterrupt and it shows the traceback otherwise it looks like whole operation stopped at a random point and nothing gets printed to the console anymore. I had this happen multiple times so far and in another instance the traceback showed further up to the line: "await asyncio.shield(self.connection_lost_waiter)" line 321 in connection.py of websockets/asyncio where it got similarly stuck indefinitely.

I would really appreciate suggestions and help, and I can post part of the code if requested, I did not paste it initially since it is quite long.

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