Repository navigation
Conversation
…ire poisoned sessions Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
…tests Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com>
…-cleanup Signed-off-by: Markus Vahlenkamp <markus.vahlenkamp@nokia.com> # Conflicts: # pkg/datastore/target/netconf/CONTEXT.md # pkg/datastore/target/netconf/driver/scrapligo/scrapligo.go
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.
Summary
Hardens candidate datastore lifecycle and cleanup in
pkg/datastore/target/netconfso failed or interrupted transactions do not leave stale uncommitted changes or leaked locks on NETCONF targets:lock/unlocklifecycle (nc.go): Wrapscommit-datastore: candidatewrites in<lock><target><candidate/></target></lock>…<unlock>(leavingrunningmode unlocked). Under RFC 6241 §8.3.4, holding<lock>on<candidate>also causes the server to automatically discard uncommitted changes if the session drops mid-flight, while isolating<candidate>from concurrent sessions.types/errors.go,driver.go,scrapligo.go,nc.go): Classifies<lock><rpc-error>replies carrying<error-info>/<session-id>(any namespace prefix, including0for non-NETCONF lock holders) asnctypes.ErrLockHeld, failing fast without issuing<discard-changes/>. WhenLock("candidate")fails with a non-session, non-ErrLockHelderror (unlocked candidate with leftover uncommitted changes), runs<discard-changes/>once and retriesLock("candidate").nc.go): EnsuresfilterRPCErrorsfailures clean up<candidate>, and whenever post-editDiscard()orUnlock("candidate")fails, retires the session asynchronously and schedules a background reconnect (honoring theErrCapabilitiesChangedcooldown when applicable) while preserving the primarySetresult (erron failed edit/commit,SetDataResponseifCommit()already succeeded).Testing
go test -race ./pkg/datastore/target/netconf/...go test ./...