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
f"WebSocket ID: {websocket.id} - Throttling/waiting, max connection limit reached {stats['connection_count']} of max {connection_count_max} ({time.time() -now:.1f}s)")
244
244
245
245
ifDROP_EXCESS_CONNECTIONS:
246
-
whilesvmem.percent>memory_use_limit_percent:
247
-
logger.warning(f"WebSocket ID: {websocket.id} - {svmem.percent}% was > {memory_use_limit_percent}%.. delaying connecting and waiting for more free RAM ({time.time() -now:.1f}s)")
248
-
awaitasyncio.sleep(5)
249
-
iftime.time() -now>60:
250
-
logger.critical(
251
-
f"WebSocket ID: {websocket.id} - Too long waiting for memory usage to drop, dropping connection. {svmem.percent}% was > {memory_use_limit_percent}% ({time.time() -now:.1f}s)")
252
-
awaitclose_socket(websocket)
253
-
stats['dropped_threshold_reached'] +=1
254
-
return
246
+
# Run memory check in executor with timeout to prevent blocking
logger.warning(f"WebSocket ID: {websocket.id} - {svmem.percent}% was > {memory_use_limit_percent}%.. delaying connecting and waiting for more free RAM ({time.time() -now:.1f}s)")
svmem=type('obj', (object,), {'percent': 100}) # Default to high value if timeout
261
+
262
+
iftime.time() -now>60:
263
+
logger.critical(
264
+
f"WebSocket ID: {websocket.id} - Too long waiting for memory usage to drop, dropping connection. {svmem.percent}% was > {memory_use_limit_percent}% ({time.time() -now:.1f}s)")
# Log connection stats first, so we get at least this message even if memory check blocks
376
394
logger.info(f"Connections: Active count {stats['connection_count']} of max {connection_count_max}, Total processed: {stats['connection_count_total']}.")
0 commit comments