-
Notifications
You must be signed in to change notification settings - Fork 707
fix WinRM thread leak #1987
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
fix WinRM thread leak #1987
Conversation
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.
mkdirProcess and initProcess errors did not appear in the logs, but for completeness, I am also proposing to handle them.
jglick
left a comment
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.
AFAICT
| LOGGER.log(Level.FINE, () -> "Failed to signal WinRM shell: " + e.getMessage()); | ||
| } | ||
|
|
||
| try { | ||
| client.deleteShell(); | ||
| } catch (Exception e) { | ||
| LOGGER.log(Level.FINE, () -> "Failed to delete WinRM shell: " + e.getMessage()); |
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.
Why FINE and not WARNING? We do not expect exceptions here do we?
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.
From what I can tell, it’s possible to call destroy on a Terminated instance. In this case, WinRM operations are expected to fail.
I’ll look into whether there’s a straightforward way to detect this status so we can adjust the log level accordingly.
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.
In this case, WinRM operations are expected to fail.
A comment to that effect would suffice I think.
Fixes #1986
Testing done
I was unable to create tests that aren’t almost entirely reliant on mocks. I plan to test this fix using real infrastructure instead. Any advice or suggestions would be greatly appreciated.
Submitter checklist