• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Server cannot be reached after 5 minutes into the request

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a Website that generates reports. I enter the input and press 'Generate Report' button. The generation of the report(just one request) takes nearly 30 minutes. I am using ExtJS, Mysql and Tomcat server in my project.

When I hosted the project in my desktop it worked fine. But, when I hosted it in a remote server (within my organization), the request to generate report gives a 400 Bad Request response. Moreover, this response from the server comes exactly 5 minutes after the request was sent. I checked the log files in the server to find no signs of any errors or even warnings.

At the client side(browser) error message says, "400 Bad Request...We can not connect to the server you have requested." My guess is that the Network or the firewall is configured some-how to timeout any request that lasts for more than 5 minutes.

Please let me know if anyone has faced this problem.

Thank you,
Pradyumna Nandavanam
 
Sheriff
Posts: 67265
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is far too long to let a request go on. Launch the report generation as a background process and return a response right away. Give the user a way to go back and check the completion of the task.
 
Pradyumna Nandavanam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for getting back to me.

Is there no other way to tackle this issue? I mean, is there a security setting that I can change to allow the request to be treated as valid even if it takes a long time?
 
Bartender
Posts: 20828
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pradyumna Nandavanam wrote:Thank you for getting back to me.

Is there no other way to tackle this issue? I mean, is there a security setting that I can change to allow the request to be treated as valid even if it takes a long time?



It wouldn't be security. But HTTP isn't designed for long-running operations anymore that it's designed for full client/server communications. HTTP is about quick in-and-out processing. If you want something that takes a long period of time, you should hand it over to something that runs in a long-term environment and only use HTTP to submit requests, get status, and possibly modify processing (for example, "cancel").

Even if you force the server to operate in the way you want, it won't operate optimally. The webapp server has finite resources and long-running requests tie them up and make them unavailable to everyone else.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!