Add early session release for multi-instance workflows#136
Merged
nicolasbisurgi merged 3 commits intomasterfrom Apr 2, 2026
Conversation
When a workflow spans multiple TM1 instances, sessions are now released as soon as an instance has no pending or running tasks, rather than waiting for the entire workflow to complete. This significantly reduces exclusive mode blocking time for multi-instance workflows. Closes #135 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Early release was deleting entries from tm1_services, which broke integration tests that share the dict across test methods via setUpClass. Now tracks released instances in a local set instead. Also splits CI TM1 config into variable (connection details) + secret (password only) for better visibility and debugging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… connections
Early release must only fire when tm1_preserve_connections is explicitly
passed (i.e. from CLI). Integration tests share TM1Service objects across
test methods via setUpClass — logging out a shared service corrupted the
HTTP session state ("multiple cookies with name TM1SessionId").
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
dag.py: Addedget_remaining_tasks_by_instance()to query pending/running task counts per TM1 instanceexecution.py: Added_logout_instance()helper and early release logic in the DAG execution loop after each task completioncli.py: Passespreserve_connectionsandexclusive_modethrough to the execution enginedocs/features/exclusive-mode.md: New "Early Session Release" section with example and explanationtests/unit/test_early_session_release.py: 18 new tests covering DAG method, logout helper, and end-to-end early release scenariosBehavior
connection_file)connection_file)Test plan
Closes #135
🤖 Generated with Claude Code