Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Implement an equivalent to AsyncTimeOutAttribute #2044

Closed
yishaigalatzer opened this issue Feb 19, 2015 · 14 comments
Closed

Implement an equivalent to AsyncTimeOutAttribute #2044

yishaigalatzer opened this issue Feb 19, 2015 · 14 comments
Labels

Comments

@yishaigalatzer
Copy link
Contributor

We would like to be able to signal a timeout to the code below this. The design here is to call request.Abort

Related to aspnet/HttpAbstractions#197

@yishaigalatzer yishaigalatzer added this to the 6.0.0-rc1 milestone Feb 20, 2015
@yishaigalatzer
Copy link
Contributor Author

This will be a resource filter (wrapping)

@kichalla
Copy link
Member

Scenarios:

  • Client disconnects while request is being executed on the server.
    Example:
    An html page could be making ajax calls and when user navigates to other pages, the previous page's ajax calls could cause disconnects.
  • Execution timeout set on an action. Once the time elapses the given timeout value, the request should be aborted.

@kichalla
Copy link
Member

kichalla commented Mar 2, 2015

This feature has been cut, so closing it.

@kichalla kichalla closed this as completed Mar 2, 2015
@danroth27 danroth27 removed this from the 6.0.0-beta4 milestone Mar 26, 2015
@roterdam
Copy link

Is there guidance on how one can implement this? Can we just copy the code from previous mvc implementations?

@rynowak
Copy link
Member

rynowak commented Oct 14, 2015

@roterdam - this is basically provided by the framework now https://msdn.microsoft.com/en-us/library/hh139229(v=vs.110).aspx

I'd recommend creating a CTS with your desired timeout, and passing it into whatever you want to put a timeout around.

If you can tell us more about your scenario we can give more specific guidance.

@rynowak rynowak reopened this Oct 14, 2015
@rynowak
Copy link
Member

rynowak commented Oct 14, 2015

@Eilon @danroth27 - not suggesting we do any work here - just reopening to keep track of the conversation.

@kichalla kichalla removed their assignment Oct 15, 2015
@Eilon Eilon removed the wontfix label Oct 30, 2015
@Eilon Eilon added this to the Backlog milestone Dec 13, 2015
@douglasg14b
Copy link

douglasg14b commented Jan 25, 2017

@rynowak Is there a way to change the execution limit for a specific controller method in the case of long-running queries? Need a way to run long queries (such as large inserts) without them being killed part way through...

@rynowak
Copy link
Member

rynowak commented Jul 18, 2017

Closing this since there's no action item for us.

Is there a way to change the execution limit for a specific controller method in the case of long-running queries? Need a way to run long queries (such as large inserts) without them being killed part way through...

@douglasg14b - there's nothing to change because there is no execution time limit, this feature doesn't exist, you have all of the building blocks if you want to build it.

@rynowak rynowak closed this as completed Jul 18, 2017
@rynowak rynowak removed this from the Backlog milestone Jul 18, 2017
@douglasg14b
Copy link

douglasg14b commented Jul 18, 2017

@rynowak

Any long-running code terminates after exactly 120 seconds, returning a 502 Bad Gateway response, and the IIS 10.0 Detailed Error - 502.3 - Bad Gateway page. Google searches brought me to many StackOverflow posts and github issues related to execution time limits.

There definitely seems to be some sort of time limit on requests, and it has been a large hindrance on any requests that result in long running queries.

Error Information:

Module	       AspNetCoreModule
Notification    ExecuteRequestHandler
Handler	       aspNetCore
Error Code      0x80072ee2

Anything that runs for more than 120 seconds returns this error and seemingly stops running entirely.

@rynowak
Copy link
Member

rynowak commented Jul 18, 2017

Then this is coming from IIS Express

@Tratcher do you have any advice about this

@Tratcher
Copy link
Member

@douglasg14b
Copy link

@Tratcher Thank you, that's good to know, and will be handy. However, is there a way to configure that for specific controllers and endpoints? I feel like it would be awkward for the entire website to have long timeouts when only a single endpoint needs it.

@Tratcher
Copy link
Member

Tratcher commented Jul 18, 2017

Not at the moment. You need to raise the global limit as high as you need and then we can talk about how to add an additional timeout with a lower value on a per controller/action basis. This would be done by supplementing the HttpContext.RequestAborted CancellationToken with an additional timeout value, and possibly calling HttpContext.Abort() on timeout.

@douglasg14b
Copy link

Oh! I see, that makes sense.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants