-
Notifications
You must be signed in to change notification settings - Fork 229
Add connection pooling and retry logic to OPC UA writer #1751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
5f61bc6 to
984b942
Compare
- Add OPCUAConnectionManager singleton for connection pooling - Implement circuit breaker pattern to fail fast when servers are unreachable - After connection failure, skip attempts for 30s (no blocking, no memory retention) - Default to max_retries=1, retry_backoff=0 (fail fast, don't block pipeline) - Use asyncua exception types (CONNECTION_ERROR_TYPES) instead of string matching - Add support for all OPC UA numeric types
984b942 to
82e1cd6
Compare
- Circuit breaker timeout: 30s → 2s (faster retry after failure) - Default max_retries: 1 → 3 (more resilient) - Default retry_backoff_seconds: 0 → 0.015 (15ms exponential backoff) The new behavior is: - Connection fails → wait 15ms → retry - Second failure → wait 30ms → retry - Third failure → circuit opens for 2 seconds (fail fast) - After 2 seconds → retry cycle starts again
Collaborator
|
Integration tests are timing out, I increased timeout from 15 to 20 minutes but the problem is still there, can you verify if OPC tests are not hanging? |
PawelPeczek-Roboflow
approved these changes
Dec 1, 2025
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
OPCUAConnectionManagersingleton for connection poolingmax_retries=1,retry_backoff=0(fail fast, don't block pipeline)Circuit Breaker Behavior
When a connection fails:
This prevents:
Test plan