File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -92,11 +92,18 @@ async def _collect_ws_data():
9292 finally :
9393 if websocket :
9494 try :
95- # Shield cleanup from cancellation to ensure proper resource cleanup
9695 await asyncio .shield (self .unsubscribe (websocket ))
96+ except asyncio .CancelledError :
97+ logging .info ("Unsubscribe completed despite cancellation" )
98+ except Exception as e :
99+ logging .warning (f"Error during unsubscribe (non-critical): { e !s} " )
100+
101+ try :
97102 await asyncio .shield (websocket .close ())
103+ except asyncio .CancelledError :
104+ logging .info ("WebSocket close completed despite cancellation" )
98105 except Exception as e :
99- logging .error (f"Error closing websocket: { e !s} " )
106+ logging .warning (f"Error closing websocket (non-critical) : { e !s} " )
100107
101108
102109class HttpMetric (BaseMetric ):
You can’t perform that action at this time.
0 commit comments