Skip to content

Commit

Permalink
Fix for race bug in WSMan command plugin instance close operation (Po…
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHigin authored and daxian-dbw committed Feb 27, 2017
1 parent 8cf7989 commit 136213d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,13 @@ internal void CloseShellOperation(
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);
}

Expand All @@ -502,7 +500,7 @@ internal void CloseCommandOperation(
//Dbg.Assert(false, "context.shellContext not matched");
return;
}
SetThreadProperties(mgdShellSession.creationRequestDetails);

mgdShellSession.CloseCommandOperation(context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,8 @@ internal override void CloseOperation(
}
}

WSManPluginInstance.SetThreadProperties(creationRequestDetails);

bool isRcvOpShuttingDown = (context.isShuttingDown) && (context.isReceiveOperation);
bool isRcvOp = context.isReceiveOperation;
bool isShuttingDown = context.isShuttingDown;
Expand Down Expand Up @@ -797,6 +799,8 @@ internal override void CloseOperation(
}
}

WSManPluginInstance.SetThreadProperties(creationRequestDetails);

bool isRcvOp = context.isReceiveOperation;
// only one thread will be here.
bool isRcvOpShuttingDown = (context.isShuttingDown) &&
Expand Down

0 comments on commit 136213d

Please sign in to comment.