Skip to content
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

Make default stack size to be 1 MB in base16 #60811

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

clintwar
Copy link

@clintwar clintwar commented Mar 7, 2025

Make default stack size to be 1 MB in base16

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Description

Current default is expressed in decimal, however that is much larger than desired default.

Fixes #60762

@Copilot Copilot bot review requested due to automatic review settings March 7, 2025 16:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Mar 7, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 7, 2025
Copy link
Contributor

Thanks for your PR, @clintwar. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@@ -65,7 +65,7 @@ InProcessOptions::InProcessOptions(const ConfigurationSource &configurationSourc
const auto handlerSettings = aspNetCoreSection->GetKeyValuePairs(CS_ASPNETCORE_HANDLER_SETTINGS);
m_fSetCurrentDirectory = equals_ignore_case(find_element(handlerSettings, CS_ASPNETCORE_HANDLER_SET_CURRENT_DIRECTORY).value_or(L"true"), L"true");
m_fCallStartupHook = equals_ignore_case(find_element(handlerSettings, CS_ASPNETCORE_HANDLER_CALL_STARTUP_HOOK).value_or(L"true"), L"true");
m_strStackSize = find_element(handlerSettings, CS_ASPNETCORE_HANDLER_STACK_SIZE).value_or(L"1048576");
m_strStackSize = find_element(handlerSettings, CS_ASPNETCORE_HANDLER_STACK_SIZE).value_or(L"100000"); // this is correct as it should be in base16 1 MB
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might actually also rename the variable to indicate the base.

@adityamandaleeka
Copy link
Member

Thanks for finding and fixing this!

@adityamandaleeka
Copy link
Member

Sorry for the confusion here, but I just realized that the default stack size should already be 1MB... why are we ever setting this explicitly if the config option isn't set? We should confirm that the default is 1MB and just not set it unless the user specified something else.

@clintwar
Copy link
Author

Default for .net core is actually 1.5 mb.

@clintwar
Copy link
Author

and actually for x64 I believe it is 4 MB

@adityamandaleeka
Copy link
Member

Just checked... it seems like it's 1.5 MB for both 32 and 64 bit on Windows, for .NET console apps. However, I'm not sure that also applies in the IIS case. Will confirm that.

@adityamandaleeka
Copy link
Member

Looks like in IIS we might have smaller stacks. With that in mind, this change seems fine (and strictly better than it was before).

@adityamandaleeka adityamandaleeka enabled auto-merge (squash) March 21, 2025 22:03
@clintwar
Copy link
Author

Do the checks need to be re-enqueued?

@BrennanConroy
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@clintwar
Copy link
Author

I am not sure about those 3 other checks but they seem to have failed again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stackSize override is not correct value format
5 participants