After user login and doing some concurrency $.ajax
session get expired unexpectedly or application get restarted...
I have checked every tools to know the main cause such as Win Event log, IIS Log and my custom logging info but there is no proper info ....
but after some googling I crossed to this which said Inproc
mode is not reliable and unexpected Process Recycling
or the answer of question here which said if you are using InProc
session state and the AppPool
spins down, that will automatically reset all of the sessions of logged in users. So make sure you are either using some other method for session state or that the idle timeout of the AppPool
is longer than the .NET
session timeout.
can someone tell me what is my wrong ?
or can $.ajax
limitation posted data or limitation of returned string len from webmethod
cause this problem ?
My web.config
and IIS:
<sessionState timeout="120" mode="InProc"></sessionState>
UPDATE:
From what I have tested I can see Application get restarted not AppPool
or w3wp
.
I have get exception in Application_Error
but still there is no clue to know
void Application_Error(object sender, EventArgs e)
{
_logging = new Logging(Global.LogPath);
Exception exp = Server.GetLastError();
_logging.Log(LoggingMode.Error, "An error accured through the application, EX{0}", exp.ToString());
}
I also follow this link and did what that said but nothing different.
UPDATE:
in the other side I have a generic handler to process some $.ajax
request (concurrency requests)
public override void ProcessRequest(HttpContext context)
{
base.ProcessRequest(context);
HttpRequest request = context.Request;
HttpResponse response = context.Response;
response.ContentType = "text/plain";
string action = request["Action"];
switch (action)
{
case "LoadThumbnails":
response.Write(LoadThumbnails(request.GetStudyUid()));
break;
case "LoadDetails":
string detailsSeriesUid = request["seriesUID"];
string detailsStartPoint = request["strStartPoint"];
string detailsLengthPoint = request["strLenghtPoint"];
response.Write(LoadDetails(request.GetStudyUid(), detailsSeriesUid, detailsStartPoint, detailsLengthPoint));
break;
.
.
.
sometime application get restarted in LoadThumbnails()
and sometime in LoadDetails()
.
they may returns large JSON string so is there limitation for response.Write()
that reset application ?
Thanks in advance.
Aha, After many headache I have resolved the problem properly....
As Microsoft mentioned this problem occurred because of high disk I/O and I have a concurrence
$.ajax
requests to get stream from Service and Write it down to wbserver H.D.D so I am going to post the solution here may will help someone.Step 1 : So I improved my
Application_End
logging as:Step 2: And my log after unexpectedly restarting was:
Step 3: Googling about IIS configuration change at last found proper Microsoft KB about unexpected ASP.Net application shutdown
Step 4: Download
All supported x64-based versions of Windows Server 2012 R2
package and installed it on mentioned server.Step 5: Calm down and be happy because the problem has been resolved by 4 mentioned steps!!!!
I hope it be useful for you.