0

Context: We run our ASP.NET site behind an AWS load balancer which times requests out after 60 seconds. The first ever request to our site may take longer than this while caches warm up etc. There's obvious improvements we could make to this strategy, but that's beside the point for this question.

Assuming that the connection to our IIS instance is closed after 60 seconds, what happens to the execution of that request, in terms of my code being run?

Does it

  • continue even though there's no one to send the eventual response to?
  • kill the process - possibly during some disk IO operation?
  • run for the server's configured timeout value?
  • do something smarter?
Nevett
  • 966
  • 6
  • 18

1 Answers1

1

This is actually depends from your code.

If you have a loop/work that takes too long, then its waits to end, then if they go to make some data send to the connection and find that the connection is closed you have an exception. I mean that if no data send to the client to check that the connection is lost - then your process will be still running to the end.

In witch case a dead loop will close and hung up is depends from the pool configuration. There you can set the max running time, then the must waiting time until he kill your non responsive process.

The function HttpResponse.IsClientConnected checks if the client is still connected and you can use it if you like to check and abort some long time process.

Excelan
  • 112
  • 3
  • 10
Aristos
  • 66,005
  • 16
  • 114
  • 150