Last post Jul 01, 2008 05:03 AM by Zhao Ji Ma - MSFT
Jun 26, 2008 02:36 PM|hi5|LINK
I have a asp.net web page (Main.aspx) that inherits from IHttpAsyncHandler. Below are the set of things that are happening:
1.) HTTP Request hits Main.aspx page.
2.) Main.aspx executes public IAsyncResult BeginProcessRequest(HttpContext context,
3.) BeginProcessRequest invokes a backend service (via socket send) and returns IAsyncResult from BeginProcessRequest. Note HttpRequest is not yet processed as the backend service has not provided back the data required to fulfill this request.
4.) Now the client that invoked Main.aspx page, times out on its side and initiates the HTTP Request again to Main.aspx.
5.) Note, the backend service had some failure during step#3 and was not able to fulfill the backend data request and never returns and the IAsyncResult in step#3 has not invoked the AsyncCallback to notify that the request has not completed.
Question 1) I was wondering now what would happen to w3wp.exe process when its AsyncCallback is never called, will it result in a resource leak or something. If so what would be the kind of leak that I could look for in the adplus dump file....
Question 2) How can I prevent such scenarios from happening? I have no control on when the backend service would return and I understand that it is not good to wait indefinitely for backend service to return.
Question 3) Usually the backend service returns back within 10-15 seconds, I was wondering can I use some timers within ASP.NET that could notify after e.g. 30 seconds that backend service has not returned back yet and its time to notify the
client via (EndProcessRequest in ASP.NET).
Any solution examples for question#2 & 3 will be greatly appreciated.
Jul 01, 2008 05:03 AM|Zhao Ji Ma - MSFT|LINK
I was wondering now what would happen to w3wp.exe process when its AsyncCallback is never called, will it result in a resource leak or something. If so what would be the kind of leak that I could look for in the adplus dump file....
It could cause leak issue.
According to your description, use some timers seems like a possible solution. Wait for
the time interval which could be set by the timer and exit the wait handler if the server doesn't return before the the timer.