-
Notifications
You must be signed in to change notification settings - Fork 118
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
Close an SSH session when an auth fails #885
Conversation
Motivation: An SSH session wasn't closed when an exception is raised while calling `session.auth()` Modification: - Close an SSH session when an exception is raised while calling `session.auth()` Result: - An SSH session is closed even an exception is raised while calling `sesison.auth()`
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #885 +/- ##
============================================
- Coverage 65.93% 65.89% -0.05%
+ Complexity 3373 3369 -4
============================================
Files 360 360
Lines 14025 14020 -5
Branches 1505 1502 -3
============================================
- Hits 9248 9238 -10
- Misses 3918 3924 +6
+ Partials 859 858 -1
☔ View full report in Codecov by Sentry. |
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 for the quick fix! 🙇♂️
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.
Looks good! Thanks @minwoox 🙇 👍 🙇
throw new RuntimeException(e); | ||
} catch (Throwable t) { | ||
if (session != null) { | ||
session.close(true); |
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.
Understood that this is the actual point that is expected to fix the start/stop logs
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.
That is correct. 👍
Motivation:
An SSH session wasn't closed when an exception was raised while calling
session.auth()
Modification:
session.auth()
Result:
sesison.auth()