2 (two) minute connection reset on file upload and processing

2 (two) minute connection reset on file upload and processing

  
The scenario is an Excel file that only contains composite rows made up of legacy (from original database) foreign keys is uploaded and the links are created in a bridge entity. There are look-ups done for each row to get the OS entity ID's that are associated with the legacy foreign keys.
 
This has worked with no issues on OS 9.0.0.6 running on 2008 R2 with SQL 2008.
 
The application has been moved to OS 9.0.0.19 running on 2008 R2 with SQL 2012.
 
Without fail the processing terminates after 120 seconds.
 
A server 500 error is returned to the browser.
OS records a "Request timed out" in the Error Log.
Windows 2008 R2 records "Error closing the transaction to the database: Invalid operation. The connection is closed" and "The request has been aborted"
No events or errors are recorded on the SQL server that I can see.
 
When running the upload process in private debug and public debug the load completes successfully within 3 minutes.
 
Only when running normally is the error being thrown.
 
I have increased the IIS HTTP timeout from 120 seconds to 300 seconds and this did not have any affect.
 
Is there another config location that manages timeouts and is defaulted to 120 seconds?
 
Unfortunately I cannot provide the OML or Excel.
 
Thanks
Ouen
Hi Ouen,

It can also be set in your machine.config file. The default timeout is actually 110seg if you didn't set anything there manually.

Also I don't recommend changing it there (or at the IIS level) since it will affect all the requests, instead of only the one you require.
The correct way is to use the SetRequestTimeout action from the HttpRequestHander extension in the flow where you need a higher timeout.
Here a related topic with a screenshot: http://www.outsystems.com/forums/discussion/12959/handling-web-reference-timeouts/#Post47187

Regards,
João Rosado
João,
 
Thanks for the info and link from which I decided to follow your advice of moving the activity to a process rather than leave it long running via the web screen.
 
The implementation seems to work but I have run into an issue where the process errors every 5 minutes.
 
Windows 2008 R2 records "Error closing the transaction to the database: This SqlTransaction has completed; it is no longer usable."
 
OS reports that "System.Web.HttpException: Request timed out."
 
The current screen action flow is:
PreRequisite. Upload a file using Popup_Upload
1. Get the Notify message
2. Pass it to a the process launch execution step
3. Return to the calling web screen
 
The process flow is:
1. Check for existing process instance in custom entity
2. Execute an automatic activity which contains my original import process
3. Import process which populates the custom process entity and walks the Excel sheet which then creates the entity references
4. Execute a human activity which advises that the import is complete
 
The import process runs fine in both debug modes when called directly. The original issue of the 2 minute timeout is gone but it is now replaced with what would appear to be a timeout against the database for some reason.
 
What is confusing me is the HTTP request time error. Should I implement the SetRequestTimeout in the import user activity even though it is not being called by a web screen or is there some other item that I am missing?
 
Thanks
Ouen
RESOLVED:

I can confirm that the SetRequestTimeout action from the HttpRequestHander extension must be included in the user action even though no web calls are taking place in the action.

The other action I took was to create a seperate applciation pool and increase the recycle timeout.

Now the long running process completes with no issues.

Thanks
Ouen
Hi Joao, 
            I was wondering what SetRequestTimeout action do behind the scene to increase timeout ? Thanks.

Regards

João Rosado wrote:
Hi Ouen,

It can also be set in your machine.config file. The default timeout is actually 110seg if you didn't set anything there manually.

Also I don't recommend changing it there (or at the IIS level) since it will affect all the requests, instead of only the one you require.
The correct way is to use the SetRequestTimeout action from the HttpRequestHander extension in the flow where you need a higher timeout.
Here a related topic with a screenshot: http://www.outsystems.com/forums/discussion/12959/handling-web-reference-timeouts/#Post47187

Regards,
João Rosado
 
 
Hi Kota,

Why do you need to know the internal workings of it?
The SetRequestTimeout action is the only supported way of dinamically controlling the request timeout in the platform.
...I could tell you what it calls internally, but using the internal code directly can break at any point...

Regads,
João Rosado
Joao, I just wanted to know if it is as simple as doing HttpWebRequest.Timeout  like we do in C#. Also are there any caveats of using it in a request ?

Thanks

 

No,

the issue here is the current request (that is being handled by IIS) itself, not an external HttpWebRequest call, so there is no HttpWebRequest object at all.

There can be issues if you set an high timeout on many concurrent requests, because there are limits of how many requests IIS can handle simultameoslly (and even the CPU load if the requests are CPU heavy). So having many "slow" requests can afect the overall performance of the server.

Regards,
João Rosado