Errors are not saved on close-session error #141
Labels
No labels
breaking-change
bug
dependencies
duplicate
enhancement
go
good first issue
help wanted
invalid
investigation
proposal
proposal-accepted
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nemith/netconf#141
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When the session is closed, the "close-session" netconf message is sent.
If any netconf errors occurs during the close, they are not propagated to the user.
In session.go (Close) we have:
The comment indicates that errors from this operation are saved, but there are no traces of this in the code.
The resp variable is not used anywhere else in the code.
If this code is replaced by;
I suppose by doing this, the errors should be extracted from the response and saved in closeErr ?
I remember this being somewhat intentional in an effort to simplify the close operation (but i forgot to remove the comment).
Is this something found during code review or some functionality you need? Do you know what functionality you would desire here?
Hello Brandon, and thanks for the swift reply!
Yes, we have in some cases seen that when doing a EditConfig operation towards a running configuration, that operation is successful but errors are reported on a subsequential Close of the session. These errors are now lost, since the body of the close-session response is completely ignored. With the change above, those errors would be propagated to the user
doing the close (after closing the underlying sockets). Would this break anything else?
Shouldn't break anything. It will break some unit tests but that is a problem with the unit tests and not the implementation.
I ran the unit tests with this change, and they still passed from what I could see.