Skip to content
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

Avoid spurious SessionCloseError when intentionally closing session. #268

Merged
merged 2 commits into from
Aug 20, 2018

Conversation

glennmatthews
Copy link

Noticed that when sending a CloseSession RPC, which calls session.close(), ncclient still logs a debug about SessionCloseError("Unexpected session close") and calls close() a second time.

Solution: Add a _closing event and set its flag when close() has been called already; if thread detects that the session is closed and this flag is set, treat it as a graceful exit rather than raising an exception.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 69.131% when pulling ace0cae on glennmatthews:spurious-session-close-error into 8ef20f2 on ncclient:master.

@coveralls
Copy link

coveralls commented Aug 20, 2018

Coverage Status

Coverage increased (+0.03%) to 65.836% when pulling 9569a55 on glennmatthews:spurious-session-close-error into fb094c7 on ncclient:master.

@einarnn einarnn merged commit a95d859 into ncclient:master Aug 20, 2018
@jfindlay jfindlay mentioned this pull request Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants