File tree Expand file tree Collapse file tree 2 files changed +407
-9
lines changed
src/databricks/sql/telemetry Expand file tree Collapse file tree 2 files changed +407
-9
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ class TelemetryClient(BaseTelemetryClient):
149
149
# Telemetry endpoint paths
150
150
TELEMETRY_AUTHENTICATED_PATH = "/telemetry-ext"
151
151
TELEMETRY_UNAUTHENTICATED_PATH = "/telemetry-unauth"
152
+ DEFAULT_BATCH_SIZE = 10
152
153
153
154
def __init__ (
154
155
self ,
@@ -160,7 +161,7 @@ def __init__(
160
161
):
161
162
logger .debug ("Initializing TelemetryClient for connection: %s" , session_id_hex )
162
163
self ._telemetry_enabled = telemetry_enabled
163
- self ._batch_size = 10 # TODO: Decide on batch size
164
+ self ._batch_size = self . DEFAULT_BATCH_SIZE # TODO: Decide on batch size
164
165
self ._session_id_hex = session_id_hex
165
166
self ._auth_provider = auth_provider
166
167
self ._user_agent = None
@@ -431,6 +432,9 @@ def close(session_id_hex):
431
432
logger .debug (
432
433
"No more telemetry clients, shutting down thread pool executor"
433
434
)
434
- TelemetryClientFactory ._executor .shutdown (wait = True )
435
+ try :
436
+ TelemetryClientFactory ._executor .shutdown (wait = True )
437
+ except Exception as e :
438
+ logger .debug ("Failed to shutdown thread pool executor: %s" , e )
435
439
TelemetryClientFactory ._executor = None
436
440
TelemetryClientFactory ._initialized = False
You can’t perform that action at this time.
0 commit comments