0

I have a controller action that does heavy computation and takes 10 minutes or more to complete.

def timeConsumingOperation(){


}

when i request the url /application/timeConsumingOperation after sometime of waiting the browser shows timeout or service unavailable.

My question is does this timeout also stop the backend method from running or even though the connection to the server is detached, the method will run till completion in the backend? Thanks for the answer!

kofhearts
  • 3,607
  • 8
  • 46
  • 79

1 Answers1

2

If this timeout is enforced solely by your browser, the operation will continue, but may fail. In particular, the response output stream will be closed and any attempts to write to it will throw exceptions.

Daniel
  • 3,312
  • 1
  • 14
  • 31
  • thanks! so if the controller action doesnt throw an exception then the method completes right? – kofhearts Jul 31 '19 at 06:31
  • Yes, though I guess it could throw an exception that you then catch and it doesn't complete they way you wanted it to. But in general, yes the action will complete as long as the server doesn't go down and no exceptions are thrown. – Daniel Jul 31 '19 at 16:32