Skip to content

Alternative for setting request timeouts for in-process hosting #12330

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

Closed
guardrex opened this issue May 8, 2019 — with docs.microsoft.com · 13 comments
Closed

Alternative for setting request timeouts for in-process hosting #12330

guardrex opened this issue May 8, 2019 — with docs.microsoft.com · 13 comments
Labels
Pri2 Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

Copy link
Collaborator

guardrex commented May 8, 2019

From @effyteva on #5449 ...

As "ANCM: RequestTimeout doesn't apply to inProcess aspnet/IISIntegration#555",

What's the recommended alternative for setting request timeouts when using in process?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added the Source - Docs.ms Docs Customer feedback via GitHub Issue label May 8, 2019
@guardrex guardrex self-assigned this May 8, 2019
@guardrex guardrex added the Pri2 label May 8, 2019
@guardrex guardrex added this to the 2019 Q2 ends June 30 milestone May 8, 2019
@effyteva
Copy link

effyteva commented May 8, 2019

Thank you @guardrex
I've actually kept digging, and figured out it's even a bit harder to work with than I thought.
I tried switching to OutOfProcess, in which the RequestTimeout parameter works.
The request was aborted and the client got the error page "The specified CGI application encountered an error and the server terminated the process.".

However, the server keeps processing infinitely, which left the server in an invalid state, until it is restarted.

Re-producing is very easy, I created a Razor View, with a "while (true)" loop in it.
I couldn't get it to abort after any kind of timeout setting.

@guardrex
Copy link
Collaborator Author

guardrex commented May 8, 2019

Yes, and your experience matches what engineering said on that issue ...

The in-proc corollary is waiting for the application to process the request.

Since any app can just swallow the request and we don't address that scenario anywhere in the docs as far as I know, you ask a great question. What we need to do on this issue is mark it for the Product Unit ("PU" label) so that they can tell us what they think about an alternative.

Now that Preview4 is out, I think (hope) that they'll look at this soon. I'll take their guidance and enhance that remark in the topic. We should at the very least say what engineering said: The app is left to process the request without a timeout by IIS/ANCM.

Note to shirhatti: I'll work this and remove the "PU" label when there's guidance available.

@guardrex guardrex added the PU label May 8, 2019
@effyteva
Copy link

effyteva commented May 8, 2019

Thanks, I highly appreciate your quick and detailed responses.
Let's see what the Product Units team comes up with, hopefully there's a simple and effective way to abort these abandoned requests.

@guardrex
Copy link
Collaborator Author

guardrex commented May 8, 2019

This is old but interesting ... might lead to some newer info or an approach.

aspnet/KestrelHttpServer#611

@effyteva
Copy link

effyteva commented May 8, 2019

This is old but interesting ... might lead to some newer info or an approach.

aspnet/KestrelHttpServer#611

Sadly it's related to ASP.NET and not ASP.NET Core.
The Server property doesn't exist anymore.

@guardrex
Copy link
Collaborator Author

guardrex commented May 8, 2019

Kestrel is the server in that scenario, so they're discussing how it would work with Core.

@guardrex
Copy link
Collaborator Author

guardrex commented May 8, 2019

Ben has an "execution timeout" ... I'll track that down and see if it went in.

@guardrex
Copy link
Collaborator Author

guardrex commented May 8, 2019

@guardrex
Copy link
Collaborator Author

guardrex commented May 8, 2019

... and here's why ... aspnet/KestrelHttpServer#485 (comment)

@effyteva
Copy link

effyteva commented May 8, 2019

I see, not sure how to proceed from here,
I understand the issue with Tasks not being able to Abort ("kill") the same way Threads could've been aborted.
However, this means the in case of a CPU bound loop (such as the "while (true)"), the only solution is to restart Kestrel completely, which doesn't make much sense.

@guardrex
Copy link
Collaborator Author

guardrex commented May 8, 2019

It sounds like this isn't just a nice-to-have scenario for you. You probably should ask the engineers directly for additional guidance ...

https://github.com/aspnet/AspNetCore/issues

If you open over there, I recommend cross-linking those two prior discussion points into your issue. It will probably refresh them as to what was said:

If you get an answer, plz do write back on this issue what you work out. We have a few options: We could (with their approval) roll their/your guidance into the topic. Alternatively, we could cross-link your engineering issue into the docs.

@effyteva
Copy link

effyteva commented May 8, 2019

Will do, thanks you @guardrex !

@guardrex
Copy link
Collaborator Author

Closing. See: dotnet/aspnetcore#10079

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pri2 Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
None yet
Development

No branches or pull requests

3 participants