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

Close an SSH session when an auth fails #885

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Conversation

minwoox
Copy link
Member

@minwoox minwoox commented Sep 15, 2023

Motivation:
An SSH session wasn't closed when an exception was 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 when an exception is raised while calling sesison.auth()

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
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Patch coverage: 82.60% and project coverage change: -0.05% ⚠️

Comparison is base (03540a1) 65.93% compared to head (b2419b4) 65.89%.

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     
Files Changed Coverage Δ
...traldogma/server/internal/mirror/SshGitMirror.java 77.52% <81.81%> (+0.68%) ⬆️
...com/linecorp/centraldogma/server/CentralDogma.java 74.78% <100.00%> (+0.05%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@ikhoon ikhoon left a 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! 🙇‍♂️

@ikhoon ikhoon added this to the 0.62.2 milestone Sep 15, 2023
Copy link
Contributor

@jrhee17 jrhee17 left a 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);
Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. 👍

@ikhoon ikhoon merged commit 75dfb2b into line:main Sep 25, 2023
9 of 10 checks passed
@minwoox minwoox deleted the close_session branch September 25, 2023 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants