Skip to content

Conversation

@apuig
Copy link
Contributor

@apuig apuig commented Dec 10, 2025

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

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

Copy link
Contributor Author

@apuig apuig Dec 10, 2025

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

jglick commented Dec 15, 2025

see #1986

Did you mean

fixes #1986

to link the PR to the issue?

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

AFAICT

Comment on lines +93 to +99
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());
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@res0nance res0nance merged commit 06dadaa into jenkinsci:master Dec 16, 2025
16 checks passed
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.

Windows Agent Thread Leak when using WinRM

3 participants