• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Server cannot be reached after 5 minutes into the request

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Saloon Keeper
Posts: 28486
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic