@@ -483,9 +483,17 @@ def initialize_telemetry_client(
483483 ):
484484 """Initialize a telemetry client for a specific connection if telemetry is enabled"""
485485 try :
486- print ("Initializing telemetry client: %s" , session_id_hex )
486+ print (
487+ "\n WAITING: Initializing telemetry client: %s" ,
488+ session_id_hex ,
489+ flush = True ,
490+ )
487491 with TelemetryClientFactory ._lock :
488- print ("Initializing telemetry client, got lock: %s" , session_id_hex )
492+ print (
493+ "\n ACQUIRED: Initializing telemetry client, got lock: %s" ,
494+ session_id_hex ,
495+ flush = True ,
496+ )
489497 TelemetryClientFactory ._initialize ()
490498
491499 if session_id_hex not in TelemetryClientFactory ._clients :
@@ -507,7 +515,11 @@ def initialize_telemetry_client(
507515 TelemetryClientFactory ._clients [
508516 session_id_hex
509517 ] = NoopTelemetryClient ()
510- print ("Telemetry client initialized: %s" , session_id_hex )
518+ print (
519+ "\n RELEASED: Telemetry client initialized: %s" ,
520+ session_id_hex ,
521+ flush = True ,
522+ )
511523 except Exception as e :
512524 logger .debug ("Failed to initialize telemetry client: %s" , e )
513525 # Fallback to NoopTelemetryClient to ensure connection doesn't fail
@@ -532,9 +544,13 @@ def get_telemetry_client(session_id_hex):
532544 @staticmethod
533545 def close (session_id_hex ):
534546 """Close and remove the telemetry client for a specific connection"""
535- print ("Closing telemetry client: %s" , session_id_hex )
547+ print ("\n WAITING: Closing telemetry client: %s" , session_id_hex , flush = True )
536548 with TelemetryClientFactory ._lock :
537- print ("Closing telemetry client, got lock: %s" , session_id_hex )
549+ print (
550+ "\n ACQUIRED: Closing telemetry client, got lock: %s" ,
551+ session_id_hex ,
552+ flush = True ,
553+ )
538554 if (
539555 telemetry_client := TelemetryClientFactory ._clients .pop (
540556 session_id_hex , None
@@ -550,8 +566,16 @@ def close(session_id_hex):
550566 logger .debug (
551567 "No more telemetry clients, shutting down thread pool executor"
552568 )
553- print ("Shutting down thread pool executor: %s" , session_id_hex )
569+ print (
570+ "\n SHUTDOWN: Shutting down thread pool executor: %s" ,
571+ session_id_hex ,
572+ flush = True ,
573+ )
554574 TelemetryClientFactory ._executor .shutdown (wait = True )
555575 TelemetryClientFactory ._executor = None
556576 TelemetryClientFactory ._initialized = False
557- print ("Thread pool executor shut down: %s" , session_id_hex )
577+ print (
578+ "\n RELEASED: Thread pool executor shut down: %s" ,
579+ session_id_hex ,
580+ flush = True ,
581+ )
0 commit comments