FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix race condition exception on recent change to OutOfProc transport by PaulHigin · Pull Request #11406 · PowerShell/PowerShell · GitHub

Fix race condition exception on recent change to OutOfProc transport - #11406

Merged
Andrew (anmenaga) merged 3 commits into
PowerShell:masterfrom
PaulHigin:fix-outofproctrans-closesession-race
Dec 20, 2019
Merged

Fix race condition exception on recent change to OutOfProc transport#11406
Andrew (anmenaga) merged 3 commits into
PowerShell:masterfrom
PaulHigin:fix-outofproctrans-closesession-race

Conversation

Copy link
Copy Markdown
Contributor

PR Summary

This PR fixes an exception thrown during a race condition in the OutOfProc transport base class, when a session is closed but command data is still being processed on the client.

PR Context

A recent change to the OutOfProc transport base class, adds separate processing threads for command and session messages. The processing threads are ended by setting the message BlockingCollection objects to complete. But this is done at session close when there can still be command data messages to process, and this resulted in an InvalidOperationException error.

To fix this, two changes were made:

  1. Try/catch added to handle any late coming message events.
  2. Move the message queue object completion to Dispose() method, to ensure message processing is closed at the very end of the transport lifetime.

PR Checklist

Andrew (anmenaga) added this to the 7.1.0-preview.1 milestone Dec 20, 2019
Andrew (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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL