-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Set local pipeline thread stack size #5927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2404c5d to
5096276
Compare
5096276 to
35a3378
Compare
| public ProtectedEventLogging ProtectedEventLogging { get; set; } | ||
| public Transcription Transcription { get; set; } | ||
| public UpdatableHelp UpdatableHelp { get; set; } | ||
| public UpdatableHelp PipelineMaxStackSizeMB { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PipelineMaxStackSizeMB setting is not a policy in windows powershell, and thus it shouldn't be added to PowerShellPolicies. It should be a setting like psmodulepath, or executionpolicy or ConsolePrompting.
THe PipelineMaxStackSizeMB was stored at SOFTWARE\Microsoft\PowerShell\1\ShellIds in windows powershell, not at SOFTWARE\Policies\...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe previously we agreed that PowerShell Core is a separate product and it should have its policies and not use policies and configs of Windows PowerShell.
Why don't we have consistency between the settings in the file and the registry if we the consistency by default on Unix? I wouldn't be surprised if MSFT decides to port Registry API to make it easier to port applications. (I would take this into account).
Also if the settings are in different places, it is difficult to find it and makes it very difficult to configure.
Another thought is that we must put (later?) config options and GPO policies in different registry keys.
I think we should develop this my comment about priority - maybe open new tracking Issue?
Also we could open new tracking Issue (?) to enumerate config options and to solve where put different options - in policy key or/and in config key.
Today I suggest:
- Have
PipelineMaxStackSizeMB(and most other options) in registry and file. - Put
PipelineMaxStackSizeMBin "Software\Policies\Microsoft\PowerShellCore". Later we can move/duplicate it in "Software\Microsoft\PowerShellCore" - today we haven't code to process the registry branches in priority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean PipelineMaxStackSizeMB should be put in Registry on Windows. I think this setting should be in the config file only on both Windows and Unix.
As far as I understand, only the GPO related settings will live in Registry and powershell.config.json on Windows for PowerShell Core (registry setting takes precedence). Non-GPO settings that used to be stored in Registry in Windows PowerShell now should live in the config file only in PowerShell Core, such as executionpolicy, ConsolePrompting and many others. You can take a look at PSConfiguration.cs to find more of them.
The type PowerShellPolicies only represents the GPO settings. PipelineMaxStackSizeMB is not a policy setting but a normal powershell setting, so it shouldn't be put in PowerShellPolicies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daxian-dbw I wanted to create an Issue to discuss but the text was too big and I made a document #5947
| return i * 1000000; | ||
| } | ||
| } | ||
| internal static int StackSize => GetPipelineMaxStackSizeOption(10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't cache the stack size, then this static property seems not necessary as it only adds one more redirection to call GetPipelineMaxStackSizeOption.
|
@iSazonov |
|
@daxian-dbw What is "policy" in the context?
|
It's short for "Group Policy Settings". Those are the settings that are originally under "Software\Policies". Each of the settings has a corresponding GPO in "Local Group Policy Editor" in Control Panel. The new PowerShell Core ones will also be available in the editor. We will publish a The settings that are not originally under "Software\Policies" are regular powershell settings. As far as I understand, we don't use Registry for those settings but only refer to the config file. |
|
Thanks for clarify!
Is this PowerShell MSFT team solution? And why? Registry is common place for Windows applications to store settings: This is critical for enterprises. By using GPO/GPP, they can centrally manage (distribute polices and settings too) applications on workstations and server farms. |
|
For PSCore6, we want to have configuration not in the registry. This makes it easier to deploy via zip, for example, as well as support side-by-side more simply. I do agree that for an enterprise, we should support GPO. In which case, there is no issue with having both configuration and policy. |
The ability to have settings in the registry does not conflict with zip and side-by-side. (We could even enhance our API to support applications by type and name) @SteveL-MSFT What your conclusion about #5947? - I'd move it in RFC repo but it's frozen. I would have moved RFC repo here with label like |
|
I created PowerShell/PowerShell-RFC#111. Should we wait the RFC? |
|
@PowerShell/powershell-committee reviewed this and don't believe that the stack size should even be a configurable setting until there is a clear need to make it settable. Recommendation is to not even have it settable despite what Windows PowerShell did. |
|
@SteveL-MSFT Stack size default is different on different platforms - should we set the same default internally to get predictable behavior on all platforms? I think it make sense - see the original Issue. |
|
@iSazonov yes, @PowerShell/powershell-committee agrees to changing the default on all systems. We thought the only point that needed discussion from the committee was configuration. |
|
A new PR was submitted based on the committee's review: #6224 |
PR Summary
Related #4268.
PipelineMaxStackSizeMBconfiguration value from config.Thread stack OS system default size is:
We should use the same stack size for all platforms to get predictable behavior.
This value should match the Windows PowerShell value for backward compatibility (I expect that .Net Core and Windows PowerShell consume the stack as well as .Net Framework and Windows PowerShell).
Perhaps default 10MB may be too large if we use many local pipelines for paralleling. We can reconsider this later.
PR Checklist
Note: Please mark anything not applicable to this PR
NA.[feature]if the change is significant or affects feature testsWIP:to the beginning of the title and remove the prefix when the PR is ready.