4

I have an ASP.net web api that is timing out request at around ~100 seconds. One of my action methods needs more time to complete a request.

After going over various link, I have already figured out that the following will not work

a) executionTimeout & ScriptTimeout as request pipeline is completely asynchronous and those values were for synchronous pipeline back then.

b) [AsyncTimeout(seconds)] attribute as it applies only for MVC web applications and ASP web api does not reference system.web.mvc

Is there any other approach on controlling timeout for this scenario?

1
  • I'm voting to close this question as off-topic because this question doe not apply. Commented May 13, 2017 at 4:52

1 Answer 1

3

Appears that there is no timeout enforced on Web API. The timeout was happening on client side. After changing the HttpClient.Timeout value it worked.

Sign up to request clarification or add additional context in comments.

3 Comments

Frank - Can you provide a link or something? We are seeing WebAPI requests live for days, via the "Worker Processes" in IIS8. Using default value for system.web/executionTimeout. We want to kill those off after some time period.
There is no value I know of that automatically cancels the request on the Web API side. The only way to do it would be for the client (e.g. HttpClient) to set a Request Time out value. The request then gets canceled on the client side, leading to connection being aborted. Once connection is aborted the server gets a notification and that bubbles up to the ASP stack which signals cancellation on the request. If you propagate the cancellation token (from one of your API controller's action method) then it should get signaled.
Where does this value get set?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.