mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix for race bug in WSMan command plugin instance close operation (#3203)
This commit is contained in:
committed by
Dongbo Wang
parent
8cf7989b53
commit
136213d6b4
@@ -473,15 +473,13 @@ namespace System.Management.Automation.Remoting
|
||||
return;
|
||||
}
|
||||
|
||||
SetThreadProperties(mgdShellSession.creationRequestDetails);
|
||||
// update the internal data store only if this is not receive operation.
|
||||
if (!context.isReceiveOperation)
|
||||
{
|
||||
DeleteFromActiveShellSessions(context.shellContext);
|
||||
}
|
||||
|
||||
string errorMsg = StringUtil.Format(RemotingErrorIdStrings.WSManPluginOperationClose);
|
||||
System.Exception reasonForClose = new System.Exception(errorMsg);
|
||||
System.Exception reasonForClose = new System.Exception(RemotingErrorIdStrings.WSManPluginOperationClose);
|
||||
mgdShellSession.CloseOperation(context, reasonForClose);
|
||||
}
|
||||
|
||||
@@ -502,7 +500,7 @@ namespace System.Management.Automation.Remoting
|
||||
//Dbg.Assert(false, "context.shellContext not matched");
|
||||
return;
|
||||
}
|
||||
SetThreadProperties(mgdShellSession.creationRequestDetails);
|
||||
|
||||
mgdShellSession.CloseCommandOperation(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -698,6 +698,8 @@ namespace System.Management.Automation.Remoting
|
||||
}
|
||||
}
|
||||
|
||||
WSManPluginInstance.SetThreadProperties(creationRequestDetails);
|
||||
|
||||
bool isRcvOpShuttingDown = (context.isShuttingDown) && (context.isReceiveOperation);
|
||||
bool isRcvOp = context.isReceiveOperation;
|
||||
bool isShuttingDown = context.isShuttingDown;
|
||||
@@ -797,6 +799,8 @@ namespace System.Management.Automation.Remoting
|
||||
}
|
||||
}
|
||||
|
||||
WSManPluginInstance.SetThreadProperties(creationRequestDetails);
|
||||
|
||||
bool isRcvOp = context.isReceiveOperation;
|
||||
// only one thread will be here.
|
||||
bool isRcvOpShuttingDown = (context.isShuttingDown) &&
|
||||
|
||||
Reference in New Issue
Block a user