2

I deployed a .NET Web API application about 2 weeks ago in an IIS 8.0.

There is a long pending method that will process a bulk of things asynchronously, and it can take up to ~20/30 minutes (the client can either close the application and get an email with the results or wait on screen until the process finishes).

The problem happened, after 90 seconds waiting the response, the call hangs and retry to do the same call again, so for example: I try to process 15 items (insert them on DB) and after 90 seconds, the process hangs and it start again (inserting another 15 records), and eventually the whole process just hangs and never finish.

After loooong time googling and research I was able to find that the Application pool ShutDownTimeLimit for the IIS was actually killing my call, because it was idle, and didn't receive any response within the default time (which is 90 seconds). I increased the value and that basically solved my problem.

However, I'm still not sure why the action on my controller was being retriggered, do any of you know if it's possible that the IIS is actually retrying to do the call after detecting that the ShutDownTimeLimit was exceeded?

Any help would be appreciated.

PD: My frontend is just doing 1 exact call, there are no multiple calls incoming from it.

  • I am experiencing this exact same issue. Did you ever find out why the controller was being retriggered? – CBC_NS Mar 08 '18 at 16:21
  • Hi @CBC_NS my apologies for the late reply, basically, my issue was that the ShutDownTimeLimit was too low, and apparently Chrome is able to manage this scenario since establish some sort of socket and keeps pinging to know that the call is still alive. However, for IE and Firefox I had to increase the ShutDownTimeLimit to the highest value possible in order to avoid the retriggering of the controller method. – Raul Gomez Rodriguez Jun 19 '18 at 17:54

1 Answers1

0

Even the ShutDownTimeLimit was exceeded, old worker processes will shut down gracefully (finish request processing) when the shutdown time period is long enough to allow for this. However when the shutdown timelimit is reached, if there is another request in, a new worker process can be started. And i don't think IIS will retry the call(and i have tested it). So make sure there is no other call from frontend or somewhere. By the way, starting essentially long running fire-and-forget tasks inside an ApiController is not a good idea, further reading in this question.

NicoXiang
  • 429
  • 9
  • 23