-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat(inputs.opcua): Allow forcing reconnection on every gather cycle #17051
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
feat(inputs.opcua): Allow forcing reconnection on every gather cycle #17051
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skartikey just one more small suggestion...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @skartikey!
Sorry, didn't see the failing linter. Please check those!
…econnection Change ReconnectErrorThreshold from uint64 to *uint64 to distinguish between unset (nil) and explicitly set to zero Allow reconnect_error_threshold=0 to force reconnection every gather cycle Maintain backward compatibility with default threshold of 1 Add comprehensive test coverage for threshold scenarios (0, 1, 3) Fix alternating success/failure pattern for long polling intervals This enables users with long polling intervals (>1 min) to avoid OPC UA session timeout issues by forcing fresh connections on every read.
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
04637ef
to
54c69a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @skartikey!
Summary
This issue was raised in this comment following our recent work on handling session invalidation between gather cycles.
Problem
Users with long polling intervals (>1 minute) experience alternating success/failure patterns due to OPC UA session timeouts. The current implementation prevents setting
reconnect_error_threshold = 0
because it forces zero values to default to 1, making it impossible to achieve proactive reconnection behavior.Root Cause
With long polling intervals, OPC UA sessions often become stale between reads, leading to this cycle:
The fix is to allow setting
reconnect_error_threshold = 0
so that it can reconnect on every gather cycle.Configuration Examples
Checklist
Related issues
resolves #