Skip to content

Conversation

@nicolasbisurgi
Copy link
Collaborator

@nicolasbisurgi nicolasbisurgi commented Nov 25, 2025

Summary of changes

  • Add configurable exponential backoff for RemoteDisconnect retry handling
  • Add configurable exponential backoff for async operation polling
  • Preserve default behavior for backward compatibility
  • Update RestService tests

New Parameters to support the changes

RemoteDisconnect Retry

Parameter Default Description
remote_disconnect_max_retries 5 Max retry attempts
remote_disconnect_retry_delay 1.0s Initial delay
remote_disconnect_max_delay 30s Maximum delay cap
remote_disconnect_backoff_factor 2 Backoff multiplier

Example using default parameters

Retry Delay
1 1s
2 2s
3 4s
4 8s
5 16s

This strategy:

  • Reduces load on the TM1 server when it's recovering
  • Gives transient network issues more time to resolve
  • Adapts to varying network conditions between client and server

Async Polling

Parameter Default Description
async_polling_initial_delay 0.1s Initial poll delay
async_polling_max_delay 1.0s Max delay cap
async_polling_backoff_factor 2 Backoff multiplier

Backward Compatibility

Default parameters preserve existing behavior:

  • Async polling caps at 1s (same as before)
  • Both features use capped exponential backoff to prevent unbounded delays.

…connect errors

Two new parameters to control retry behavior when connection is aborted:
- remote_disconnect_max_retries: max retry attempts (default: 5)
- remote_disconnect_retry_delay: initial delay in seconds (default: 1)
- async_polling_initial_delay: initial polling delay (default: 0.1s)
- async_polling_max_delay: maximum polling delay cap (default: 1.0s)
- async_polling_backoff_factor: multiplier for exponential backoff (default: 2)
@MariusWirtz
Copy link
Collaborator

Good enhancement! Thank you @nicolasbisurgi

I have two small change requests

  • Please squash the commits into 1 commit before we merge
  • Please also list the new arguments in the docstring of the TM1Service constructor (because most people interact with the RestService only indirectly)

@nicolasbisurgi nicolasbisurgi merged commit 5eae728 into master Dec 1, 2025
@nicolasbisurgi nicolasbisurgi deleted the 1315-need-to-add-remote_disconnect_retry-handlers branch December 1, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need to add remote_disconnect_retry handlers

3 participants