Search code examples
google-app-engineservletsrequestdetectabort

Detecting client-aborted requests in AppEngine


I have a request in AppEngine that takes a little while to complete (many seconds). Is there a way to detect whether the user or some network problem has already aborted the request? This would allow me to save myself the server-load of continuing the result generation, which won't go anywhere anyways.

I tried the following in Dev-Mode, but neither worked (haven't checked yet whether it behaves differently in production mode):

  • Checking whether resp.getOutputStream completes without throwing an IOException
  • Checking whether there was an Interrupt sent to the servlet thread

Thanks, Markus

PS: I am really specifically interested in this question, not in ways to restructure my app to make the request faster or prevent aborts or other things.


Solution

  • No, there is no way to detect this from inside the app. I wouldn't worry about it.