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 have an asyncio-based websocket client implemented, with an onClose method:
asyncdefonClose(self, wasClean, code, reason):
self.app.root.server_info.text=_(
'Disconnected, reconnecting in 2 seconds')
Logger.info(f'ServerTalker: Disconnected: {reason}')
# Tasks in Tasks.all_tasks() are weakref's so this will get# garbage collected# self.factory.server_talker.transport = Nonetry:
awaitaiosleep(delay=5)
exceptCancelledError:
print('||| onClose CANCELLED')
raiseawaitself.factory.server_talker.create_server_connection()
Whenever I cancel the aiosleep from outside (aiosleep is just asyncio.sleep), it seems that the CancelledError raised at that point will get swallowed by some other part of the websocket client I don't have control over.
I get the debug from my print, but when I await the cancelled task to have it properly exited, the await takes forever, as if the CancelledError have been suppressed somewhere in the underlying code (not by me).
Could you please look into this?
The text was updated successfully, but these errors were encountered:
Hey,
I have an asyncio-based websocket client implemented, with an
onClose
method:Whenever I cancel the aiosleep from outside (
aiosleep
is justasyncio.sleep
), it seems that theCancelledError
raised at that point will get swallowed by some other part of the websocket client I don't have control over.I get the debug from my print, but when I
await
the cancelled task to have it properly exited, theawait
takes forever, as if theCancelledError
have been suppressed somewhere in the underlying code (not by me).Could you please look into this?
The text was updated successfully, but these errors were encountered: