Skip to content

SSH Remoting session hangs if SSH client process abruptly terminates #4122

@PaulHigin

Description

@PaulHigin

If the SSH client process that PowerShell is using for the SSH transport terminates abruptly the StreamReader will return null instead of closing the pipe for a normal process exit.

The current error stream reading code ignores null StreamReader values resulting in a hang where the remote session never ends.

Steps to reproduce

PS > New-PSSession -HostName <cnName>
PS > Get-Process SSH | kill -force

Expected behavior

Session state goes to "Broken" with error message

Actual behavior

Session is broken and hangs on the client end

Environment data

Current build

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-RemotingPSRP issues with any transport layer

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions