Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My problem is:

HTTP request gets cancelled after 2 minutes but server side processing still continues.

I have large data processing and my database contains huge data.So i am using a normal form submit method for a processing screen and when i checked the browser console the request status becomes cancelled.But on the server the process is continuing after this request cancelling.Also when the request is cancelled a file wil be downloaded automatically which cannot be opened,also the file extension is not there.I have made the maximum execution time limit to unlimited using

set_time_limit(0);

,but it didnt changed the situation.In my code i have writted some code to write contents into a file.So after the request gets cancelled the file writing operation continues.I am trying to resolve this error but didnt find any solution.Please help me. I am using apache server.

Process i am doing:

1.Selecting large number of data from a table which contains large number of data.

2.Checks whether each record matches certian conditions.

3.Matching records are written into a file and that file is report generation.

4.Allowing the user to download the file after the process completion.

I have heared that if the client did'nt recive any response after a particular time then it will cancel the request to the server.Is this the issue with me.If so how can i resolve it.?

share|improve this question

1 Answer 1

This is normal behavior. The server doesn't know the connection has been dropped until it tries to write the data. Long running request are not a good match to a web request, as there are too many places where it can break. Browsers and firewalls will eventually drop the connection if there is no activity on the connection.

A few approaches you could try:

  • Asynchronous delivery by email.
  • Asynchronous delivery into a results folder. The use would need to submit a subsequent request and download the file.
  • An automatic refresh page the retries retrieving the report. Depending on how the processing works, it may be able to show the status of the processing.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.