Re-add check for Invoke-Command job dispose. by PaulHigin · Pull Request #11388 · PowerShell/PowerShell · GitHub
Skip to content

Re-add check for Invoke-Command job dispose.#11388

Merged
anmenaga merged 3 commits intoPowerShell:masterfrom
PaulHigin:fix-session-reconnect-regression
Dec 20, 2019
Merged

Re-add check for Invoke-Command job dispose.#11388
anmenaga merged 3 commits intoPowerShell:masterfrom
PaulHigin:fix-session-reconnect-regression

Conversation

@PaulHigin
Copy link
Copy Markdown
Contributor

PR Summary

This fixes session reconnect regression bug: #11150.

PR Context

Invoke-Command creates a disconnected job object to facilitate session re-connection, when WinRM abruptly disconnects the session due to network issues. The EndProcessing() block was disposing the disconnected job object so that a session reconnect could not occur.

Fix is to add the checks back in the code which prevents EndProcessing() from disposing the disconnected job, and added comments explaining why the code checks are there.

PR Checklist

@ghost ghost assigned TravisEz13 Dec 17, 2019
@PaulHigin PaulHigin added WG-Remoting PSRP issues with any transport layer Issue-Bug Issue has been identified as a bug in the product labels Dec 18, 2019
Copy link
Copy Markdown
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

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

Code change looks fine, possible to add a local loopback test?

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Dec 18, 2019
@PaulHigin
Copy link
Copy Markdown
Contributor Author

@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Dec 18, 2019
@PaulHigin
Copy link
Copy Markdown
Contributor Author

Actually, I thought about this some more and have found a simpler way to test this scenario. I feel the test should be reasonably reliable and will add it here. We can always remove the test if it turns out to be fragile.

@PaulHigin PaulHigin assigned anmenaga and unassigned TravisEz13 Dec 19, 2019
@anmenaga anmenaga added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Dec 20, 2019
@anmenaga anmenaga added this to the 7.1.0-preview.1 milestone Dec 20, 2019
@anmenaga anmenaga merged commit e81bd1d into PowerShell:master Dec 20, 2019
@PaulHigin PaulHigin deleted the fix-session-reconnect-regression branch December 20, 2019 20:32
@ghost
Copy link
Copy Markdown

ghost commented Mar 26, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log Issue-Bug Issue has been identified as a bug in the product WG-Remoting PSRP issues with any transport layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants