Skip to content

Commit 380b0b9

Browse files
authored
bugfix: stalling test issue (close in TelemetryClientFactory) (#609)
* removed walrus, removed random test before stalling test Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added back random test, connection debug Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * formatting Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * telemetry client factory debug Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * garbage collector Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * RLOCK IS THE SOLUTION Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed debug statements Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * remove debugs Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * removed debug Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> * added comment for RLock Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com> --------- Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent cf89ce3 commit 380b0b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ class TelemetryClientFactory:
316316
] = {} # Map of session_id_hex -> BaseTelemetryClient
317317
_executor: Optional[ThreadPoolExecutor] = None
318318
_initialized: bool = False
319-
_lock = threading.Lock() # Thread safety for factory operations
319+
_lock = threading.RLock() # Thread safety for factory operations
320+
# used RLock instead of Lock to avoid deadlocks when garbage collection is triggered
320321
_original_excepthook = None
321322
_excepthook_installed = False
322323

0 commit comments

Comments
 (0)