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

Increase stack size for host when running in IIS In-Proc #9394

Closed
analogrelay opened this issue Apr 15, 2019 · 13 comments · Fixed by #10511
Closed

Increase stack size for host when running in IIS In-Proc #9394

analogrelay opened this issue Apr 15, 2019 · 13 comments · Fixed by #10511
Assignees
Labels
accepted This issue has completed "acceptance" testing (including accessibility) area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one

Comments

@analogrelay
Copy link
Contributor

analogrelay commented Apr 15, 2019

Epic #8833

Blocked by https://github.com/dotnet/coreclr/issues/21450

Once there's an API/Property to increase the stack size, we need to react to it in IIS in two ways:

  1. Increase the default to something more appropriate for our scenario
  2. Make it configurable in web.config (if possible).
@analogrelay
Copy link
Contributor Author

ETA of the blocking issue is preview6.

@jahanford
Copy link

jahanford commented Apr 18, 2019

@anurse can the stack size limits cause issues with the inbuilt Dependency Injection or am I more likely having a dependency recursion problem? I'm having an overflow exception only present when using InProcess hosting.

@analogrelay
Copy link
Contributor Author

analogrelay commented Apr 18, 2019

I'm not specifically aware of DI issues here, but it is certainly possible. The stack size when running in IIS is significantly smaller than when running as a standard .NET Console app. The easiest way to test is to run your app directly on Kestrel and see if you still hit the StackOverflowException. If you do, it's more likely to be a runaway recursive call, if you don't it may just be a deep stack that's hitting the IIS limit.

@jahanford
Copy link

@anurse thank you for the timely response, I have no issues when running on Kestrel, hopefully this change in 3.0 fixes it up.

@analogrelay
Copy link
Contributor Author

Good to know! Yeah, that indicates you should have a better experience when we get this change in.

@analogrelay
Copy link
Contributor Author

Need to review if the corefx API is present.

@martincostello
Copy link
Member

@Projkt-James We seemed to experience the issue with 2.2.x when doing model binding, particularly when re-executing a request in an error handler.

@analogrelay
Copy link
Contributor Author

Yep, I believe model binding can also produce fairly deep stacks. This should be improved with this coming change.

@jkotalik jkotalik added the blocked The work on this issue is blocked due to some dependency label May 5, 2019
@analogrelay analogrelay added cost: M enhancement This issue represents an ask for new feature or an enhancement to an existing one labels May 7, 2019
@jkotalik
Copy link
Contributor

jkotalik commented May 7, 2019

dotnet/core-setup#5859 should be merge into our repo soon, so we can work on this.

@analogrelay analogrelay removed the blocked The work on this issue is blocked due to some dependency label May 8, 2019
@jkotalik jkotalik added 2 - Working blocked The work on this issue is blocked due to some dependency and removed 2 - Working labels May 9, 2019
@analogrelay
Copy link
Contributor Author

Still blocked on https://github.com/dotnet/coreclr/issues/21450

@analogrelay
Copy link
Contributor Author

CoreCLR builds starting with dotnet/coreclr@6a85ca5 now support the COMPlus_DefaultStackSize environment variable for configuring the default stack size in bytes (see dotnet/coreclr#24532).

There is also a runtime property DEFAULT_STACK_SIZE, but configuring that in ANCM is blocked at the moment (#9520)

@jkotalik jkotalik removed the blocked The work on this issue is blocked due to some dependency label May 17, 2019
@analogrelay analogrelay added the blocked The work on this issue is blocked due to some dependency label May 21, 2019
@analogrelay
Copy link
Contributor Author

Apparently we're behind on deps here, waiting on a new coreclr. BAR says we're 7 days old from coreclr and the commit referenced above is 7 days old.

@jkotalik jkotalik removed the blocked The work on this issue is blocked due to some dependency label May 29, 2019
@jkotalik
Copy link
Contributor

Acceptance checklist (check one item)

  • We decided not to take this fix.
  • The fix is tests-only.
  • The fix contains product changes (check all items below).
    • Relevant XML documentation comments for new public APIs are present.
    • Narrative docs (docs.microsoft.com) are updated. (check one item below)
      • The change requires a new article. An issue with an outline has been filed here: [ISSUE LINK]
      • The change requires a change to an existing article. A closed docs PR with these changes is linked here: Doc stack size limit AspNetCore.Docs#12590 (note, PR is still open)
      • The change requires no docs changes.
    • Verification has been completed. (check one item below)
      • The change is in the shared framework and was verified against the following versions
        • SDK installer: 3.0.100-preview6-012113
        • ASP.NET Core Runtime: 3.0.0-preview6-19279-01
        • .NET Core Runtime: 3.0.0-preview6-27728-04
      • The change is in an OOB NuGet/NPM/JAR package and was verified against the following version of that package: [PACKAGE ID] [VERSION]

@jkotalik jkotalik added the accepted This issue has completed "acceptance" testing (including accessibility) label May 29, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted This issue has completed "acceptance" testing (including accessibility) area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants