Skip to content

Commit 2659bad

Browse files
committed
attempt renaming lock
1 parent a990146 commit 2659bad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def close(self):
309309
_clients: Dict[str, BaseTelemetryClient] = {}
310310
_executor: Optional[ThreadPoolExecutor] = None
311311
_initialized: bool = False
312-
_lock = threading.Lock()
312+
_clients_lock = threading.Lock()
313313
_original_excepthook = None
314314
_excepthook_installed = False
315315

@@ -355,7 +355,7 @@ def initialize_telemetry_client(
355355
):
356356
"""Initialize a telemetry client for a specific connection if telemetry is enabled"""
357357
try:
358-
with _lock:
358+
with _clients_lock:
359359
_initialize()
360360
if session_id_hex not in _clients:
361361
logger.debug(
@@ -397,7 +397,7 @@ def get_telemetry_client(session_id_hex):
397397
def close_telemetry_client(session_id_hex):
398398
"""Remove the telemetry client for a specific connection"""
399399
global _initialized, _executor
400-
with _lock:
400+
with _clients_lock:
401401
if (telemetry_client := _clients.pop(session_id_hex, None)) is not None:
402402
logger.debug("Removing telemetry client for connection %s", session_id_hex)
403403
telemetry_client.close()

0 commit comments

Comments
 (0)