Skip to content

Exiting the socket is being delayed #1584

@tsunamilx

Description

@tsunamilx

I dont think the issue existed before, but I recently found that the socket (either ReconnectingSocket or KeepAliveSocket), the __aexit__ is always delayed for exact 10 seconds:

async with socket:
    print('done')
print('close')  # this message is always 10 secs late after the 'done' message  

I dig a little bit of the code and I think it is because the socket is waiting for data in the _read_loop:

res = await asyncio.wait_for(
    self.ws.recv(), timeout=self.TIMEOUT
)

and self.TIMEOUT is 10, which explains the 10 secs delay.

Am I right? And how do you remove the delay?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions