This is a migrated thread and some comments may be shown as answers.

ProgressArea/ProgressManager getting ScriptTimeout server error

3 Answers 146 Views
ProgressArea
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 01 Aug 2019, 09:30 PM

Hi;

We have a .net webforms page that selects a file via a RadAsyncUpload control (the upload part is working fine).  After the file has been selected and transferred to the server in the background by the async upload, the user clicks a button to begin processing the file in the page's code-behind. 

We had previously created added a ProgressArea to the page, hoping that the communication between the server and the client would prevent the page from timing out during long processes (the processing of a file can take up to 30 minutes).  However, while the ProgressArea worked and was a definite improvement, the page request would still not have the response sent until the entire code-behind processing was complete, and thus the page would hit the http timeout limit (2 mins by default, I believe) before the server was finished processing, and we would get a "System.Web.HttpException (0x80004005): Request timed out." error.  Finally, we ended up just extending that page's timeout to an hour with the code

 

Server.ScriptTimeout = 3600;

in the Page_Load event.

However, our product is available not just hosted on our servers but also as an on-site web application on customers' servers -- this addresses security issues and regulations some of our customers have.  As a result, we do not have full control over the environment in which the software runs.  We've recently had a customer add AWS Cloudfront for content delivery, which has its own timeout settings.  This customer does not wish to set their Cloudfront http timeout to an hour, so our setting on the web application page doesn't matter.

What I am looking for is a way to keep that full response (as initiated by the user clicking the "Process" button) from timing out by keeping the server and client communicating during the processing in such a way as the http timeout doesn't get hit.  If I understand correctly, the ProgressArea sending information back from the server to the client does not "count" as part of the response the page is waiting for, so does not keep the http connection alive to prevent a timeout.

I had previously tried explicitly calling the processing from an ajax post from in a loop on the client, and while I was able to do this, the performance was drastically impacted for the worse.

Is there any way with the ProgressArea, ProgressManager, or some other telerik control to keep an http connection alive for the duration of a long process without having to change the timeout settings of any layer between the client and the web server?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 06 Aug 2019, 07:37 AM

Hello Thomas,

The way the ProgressArea works is that a postback request is done, which will do the heavy job and after the job is done, the response for this postback is returned to the client. Meanwhile, by updating the context, additional requests are exchanged between the server and client ProgressArea context. 

With that said, the ProgressArea might help with preventing the Session from timing out, but it cannot do anything to the long postback request that times out. You can try extending the timeout period only for this page, not the whole application:

Regards, Peter Milchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Thomas
Top achievements
Rank 1
answered on 06 Aug 2019, 08:55 PM

Hi Peter, thanks for the reply =)

You've confirmed what I was thinking.  Are there any options along the lines of this article on using BackgroundWorker objects in WinForms?  Maybe a way to pass the RadProgressContext object to a new thread that runs, so the ProgressArea can be updated from that? ... Thinking out loud here -- so the page itself, on the main thread, would have to return a response that doesn't refresh the entire page -- something that keeps the ProgressArea visible after the response is complete.  Then when the long-running process ends and the other thread sends the OperationComplete flag, close the ProgressArea?  Is there some option like that possible?

Thanks!

0
Peter Milchev
Telerik team
answered on 09 Aug 2019, 03:33 PM

Hello Thomas,

I am afraid that I am not aware of such a way to "refresh" the ongoing request in WebForms. 

Another thought I have is changing the design of the application, i.e. to actually return the response to the client and then fire multiple AJAX request to the server on given interval to track the progress of the long running process. 

If you find any suitable solution to this scenario, you can share it here to be visible to the community, if someone has the same conceptual difficulty.

Regards, Peter Milchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ProgressArea
Asked by
Thomas
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or