From 5aa3492705af6ba701b47682dd63d1fd88e24c3c Mon Sep 17 00:00:00 2001 From: MariusWirtz Date: Fri, 29 May 2026 17:24:36 +0200 Subject: [PATCH] Fix TM1Service kwarg collision when connection params set in config.ini setup_tm1_services spread config.ini params via **params while also passing connection_pool_size and session_context explicitly, raising "got multiple values for keyword argument 'connection_pool_size'". The exception was swallowed as "instance not accessible", dropping the instance and surfacing a misleading KeyError downstream in validate_tasks. Merge RushTI-managed values as defaults that config.ini can override. Add unit tests for the collision, the max_workers default, and session_context precedence. --- src/rushti/execution.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/rushti/execution.py b/src/rushti/execution.py index db6f058..f073eb8 100644 --- a/src/rushti/execution.py +++ b/src/rushti/execution.py @@ -195,11 +195,15 @@ def setup_tm1_services( # case no connection file provided or connection file expired if tm1_server_name not in tm1_services: resolved_params = resolve_tm1_params(config, tm1_server_name) - tm1_services[tm1_server_name] = TM1Service( - **resolved_params, - session_context=session_context, - connection_pool_size=max_workers, - ) + # RushTI-managed defaults; any value explicitly set in + # config.ini takes precedence (avoids "multiple values for + # keyword argument" when e.g. connection_pool_size is set). + service_kwargs = { + "session_context": session_context, + "connection_pool_size": max_workers, + } + service_kwargs.update(resolved_params) + tm1_services[tm1_server_name] = TM1Service(**service_kwargs) if connection_file: # implicitly re-connects if session is timed out