8000 Remove implicit remoting batch experimental feature (#15863) · PowerShell/PowerShell@1ec61d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ec61d9

Browse files
authored
Remove implicit remoting batch experimental feature (#15863)
It was decided by committee (#15862) to remove this experimental feature. It was an interesting idea but the implementation did not cover important cases, and could not be updated easily to do so.
1 parent e42343b commit 1ec61d9

File tree

10 files changed

+5
-651
lines changed

10 files changed

+5
-651
lines changed

src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,6 @@ private static void GenerateSectionSeparator(TextWriter writer)
20242024
20252025
PrivateData = @{{
20262026
ImplicitRemoting = $true
2027-
ImplicitSessionId = '{4}'
20282027
}}
20292028
}}
20302029
";
@@ -2043,8 +2042,7 @@ private void GenerateManifest(TextWriter writer, string psm1fileName, string for
20432042
CodeGeneration.EscapeSingleQuotedStringContent(_moduleGuid.ToString()),
20442043
CodeGeneration.EscapeSingleQuotedStringContent(StringUtil.Format(ImplicitRemotingStrings.ProxyModuleDescription, this.GetConnectionString())),
20452044
CodeGeneration.EscapeSingleQuotedStringContent(Path.GetFileName(psm1fileName)),
2046-
CodeGeneration.EscapeSingleQuotedStringContent(Path.GetFileName(formatPs1xmlFileName)),
2047-
_remoteRunspaceInfo.InstanceId);
2045+
CodeGeneration.EscapeSingleQuotedStringContent(Path.GetFileName(formatPs1xmlFileName)));
20482046
}
20492047

20502048
#endregion

src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -321,22 +321,6 @@ internal Collection<PSObject> ExecuteCommand(string command, out Exception excep
321321
{
322322
Dbg.Assert(!string.IsNullOrEmpty(command), "command should have a value");
323323

324-
// Experimental:
325-
// Check for implicit remoting commands that can be batched, and execute as batched if able.
326-
if (ExperimentalFeature.IsEnabled("PSImplicitRemotingBatching"))
327-
{
328-
var addOutputter = ((options & ExecutionOptions.AddOutputter) > 0);
329-
if (addOutputter &&
330-
!_parent.RunspaceRef.IsRunspaceOverridden &&
331-
_parent.RunspaceRef.Runspace.ExecutionContext.Modules != null &&
332-
_parent.RunspaceRef.Runspace.ExecutionContext.Modules.IsImplicitRemotingModuleLoaded &&
333-
Utils.TryRunAsImplicitBatch(command, _parent.RunspaceRef.Runspace))
334-
{
335-
exceptionThrown = null;
336-
return null;
337-
}
338-
}
339-
340324
Pipeline tempPipeline = CreatePipeline(command, (options & ExecutionOptions.AddToHistory) > 0);
341325

342326
return ExecuteCommandHelper(tempPipeline, out exceptionThrown, options);

src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ static ExperimentalFeature()
104104
name: "PSFileSystemProviderV2",
105105
description: "Replace the old FileSystemProvider with cleaner design and faster code"),
106106
*/
107-
new ExperimentalFeature(
108-
name: "PSImplicitRemotingBatching",
109-
description: "Batch implicit remoting proxy commands to improve performance"),
110107
new ExperimentalFeature(
111108
name: "PSCommandNotFoundSuggestion",
112109
description: "Recommend potential commands based on fuzzy search on a CommandNotFoundException"),

src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5177,21 +5177,6 @@ internal void RemoveModule(PSModuleInfo module, string moduleNameInRemoveModuleC
51775177

51785178
// And the appdomain level module path cache.
51795179
PSModuleInfo.RemoveFromAppDomainLevelCache(module.Name);
5180-
5181-
// Update implicit module loaded property
5182-
if (Context.Modules.IsImplicitRemotingModuleLoaded)
5183-
{
5184-
Context.Modules.IsImplicitRemotingModuleLoaded = false;
5185-
foreach (var modInfo in Context.Modules.ModuleTable.Values)
5186-
{
5187-
var privateData = modInfo.PrivateData as Hashtable;
5188-
if ((privateData != null) && privateData.ContainsKey("ImplicitRemoting"))
5189-
{
5190-
Context.Modules.IsImplicitRemotingModuleLoaded = true;
5191-
break;
5192-
}
5193-
}
5194-
}
51955180
}
51965181
}
51975182
}
@@ -6924,13 +6909,6 @@ internal static void AddModuleToModuleTables(ExecutionContext context, SessionSt
69246909
{
69256910
targetSessionState.Module.AddNestedModule(module);
69266911
}
6927-
6928-
var privateDataHashTable = module.PrivateData as Hashtable;
6929-
if (!context.Modules.IsImplicitRemotingModuleLoaded &&
6930-
privateDataHashTable != null && privateDataHashTable.ContainsKey("ImplicitRemoting"))
6931-
{
6932-
context.Modules.IsImplicitRemotingModuleLoaded = true;
6933-
}
69346912
}
69356913

69366914
/// <summary>

src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ internal ModuleIntrinsics(ExecutionContext context)
5454

5555
private const int MaxModuleNestingDepth = 10;
5656

57-
/// <summary>
58-
/// Gets and sets boolean that indicates when an implicit remoting module is loaded.
59-
/// </summary>
60-
internal bool IsImplicitRemotingModuleLoaded
61-
{
62-
get;
63-
set;
64-
}
65-
6657
internal void IncrementModuleNestingDepth(PSCmdlet cmdlet, string path)
6758
{
6859
if (++ModuleNestingDepth > MaxModuleNestingDepth)

0 commit comments

Comments
 (0)
0