Repository navigation
Conversation
gnmiSubscribe returned on the first error reported by the target's subscription. The target resubscribes on its own and uses that channel only to report each failure, so after a device restart nothing consumed the subscription any more: running was never refreshed and no deviation was detected, while the connection status still read connected. Treat those errors as non-fatal. Following a failure, the next initial sync is a full snapshot and replaces the configured sync paths in running, so config lost on the device surfaces as a deviation instead of being merged into stale state. An empty snapshot still clears the paths. The resubscribe and sync-response events now travel through the notification channel behind all earlier notifications, ticker commits are held back until the snapshot arrives, and commits reach running in the order they were started. Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
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.
Refs #542 (gNMI half; the NETCONF reconnect is handled separately, so this does not close the issue).
Problem
gnmiSubscribereturned on the first error reported by the target's subscription. gnmic resubscribes on its own and uses that channel only to report each failure, so after a device restart nothing consumed the subscription any more. Running was never refreshed and no deviation was detected, while the connection status still read connected. Restarting data-server was the only way out.Change
SyncResponsecould overtake notifications, which would now matter because a replace with a partial snapshot would drop data.Behaviour to be aware of
Startdoes not fail.Tests
TestGnmiSubscribe_StreamErrorKeepsSyncAliveTestStreamSync_ResubscribeReplacesSyncedPaths(first sync merges only; resync with empty device config clears the paths; resync with config imports it)Both fail without the change.
go test ./pkg/datastore/target/gnmi/ -racepasses; not verified against a real gNMI device.