5

i have an application which gets random session timeouts. (IIS 7.5 on Windows 2008 R2, .NET 4.0)

i tried the following:

  • checked the application log if the w3wp.exe process was crashed, but there is no entry.
  • disabled in the application pool the rapid fail protection
  • moved to the sql server state provider to be sure the loadbalancers sticky session is not the problem. (we use a kemp loadmaster).
  • ensured that no other applications use the same application pool.
  • checked that exceptions in a thread of a called assembly is correctly handled. (simulated using throw new exception) and the error handling was correct.
  • ensured that the validationKey and decryptionKey is set in the webconfig on all 4 webservers to the same key.

i run now out of ideas how to spot this evil bug. any suggestions? i cannot reproduce the problem on my local machine in the debugger.

one point which is maybe important, the move from page 1 to page 2 where the session loss often happens, takes sometimes more than 120 seconds, because of a third party system which is connected via tcp socket.

7
  • So when you're debugging locally, is it not possible to simulate a timeout or long-running call from this 3rd-party system? Commented May 25, 2011 at 11:37
  • i did that using a thread.sleep but the problem is not happening. Commented May 25, 2011 at 11:42
  • i just mentioned it because maybe someone knows some secret iis setting i forgot. also if such a timeout happens, i expect an entry in the application section of the event log. Commented May 25, 2011 at 11:45
  • I hope someone has ideas in the direction: iis settings, crazy memory dump analysis maybe using a specific script usign windebug or some special log modis of the iis whatever. i have no more ideas ;-( Commented May 25, 2011 at 11:47
  • Update: i never can reproduce this problem, i just got complains from outside and see it frequently in the log. Moving code out does not help as i cannot reproduce it and without it, it makes no sense as its a b2c site. Commented May 27, 2011 at 11:44

2 Answers 2

7

HI Snoopy you linked to my question as they are similar,

As my appool was crashing I tried this solution. If your appool crash's this may help http://support.microsoft.com/kb/911816

the solution stop fix hack kept my app-pool up but didn't fix the problem,

<configuration>
<runtime>
    <legacyUnhandledExceptionPolicy enabled="true" />
</runtime>

If your app-pool is still intact you might try ELMAH as this helped me a lot http://code.google.com/p/elmah/

you can use this code to get ELMAH to handle unmanaged exceptions http://code.google.com/p/elmah/issues/detail?id=199

I am curious if it is MVC 3.0 problem with .net 4.0 as i have several very similar apps running using MVC 2.0 with no problems, Only started when I moved to MVC 3.0

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, i try this out. I dont use ELMAH, i use gurock.com/smartinspect
2

Does it happen on a single server? Sure sounds like an issue with the web-farm.

Can you alter your app so you don't use the 3rd-party app for testing?

You have to eliminate pieces until the failure goes away, then add stuff back. Restore 3rd party app, turn other servers back on, etc.

2 Comments

the problem is on a single server you can never reproduce it. the system does nothing than showing data from the 3rd party system; i send a xml request via tcp and and get a xml answer via tcp. this takes normally 45seconds, sometimes up to 3 minutes. my question is a bit more general, what would you do next? which settings, logs should i check.
Well I would start with the 3rd party app. Maybe 'fake' up an XML response so the rest of your page is happy but the app is not actually called. If the session still gets lost, that's not the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.