1

I'm seeing something very odd: for environmental background:

  • I have a couple of servers on a load balancer (sticky IS turned on)
  • I'm keeping an object in session - one property of this object may contain a somewhat large amount of data.

The process:

  • I'll upload an image, keeping a copy of it in session because I'm doing some manipulation on it (it's pre-resized to a fairly consistent width so size shouldn't be an issue)
  • I'm logging everything and can confirm that it's not switching servers (the loadbalancer IS working correctly)
  • in one browser I'll upload an image, do some basic manipulation (rotations)
  • in a second browser I'll upload the same image do a couple more rotates.
  • after a minute (sometimes) the second browser looses the variable in session containing the image
  • I can still manipulate the image in the first browser.

After looking at the logging: session ID is consistent from call to call, it just appears that session #2's variable was set to null.

I should note that we've seen this when we hit the either server directly.

Can anybody give me a good place to start looking? (I've already made sure that I'm not doing something silly and setting the variable to null or a null value)

Thanks for any and all help!

Invalid Character
  • 203
  • 1
  • 5
  • 15
  • Could you just set the session timeout to a longer time? http://stackoverflow.com/questions/1205828/set-session-timeout-in-web-config – Jon La Marr Aug 23 '13 at 17:13
  • Is it In-Proc or Out-Proc session storage? You can probably use Fiddler or Microsoft Network Monitor to track down the session loss behavior while reproducing the issue. – Prashant Aug 23 '13 at 17:13
  • Can you confirm you're not switching servers? Maybe put something into the footer to indicate which machine you're on? – Tim Aug 23 '13 at 17:19
  • @Jon La Marr: the session is st to 60 minutes: it should be sufficient. Additionally I should note that the above flow took place over 4 minutes. – Invalid Character Aug 23 '13 at 17:25
  • @Prashant - this is not s session loss - the session ID stays consistent over all requests. – Invalid Character Aug 23 '13 at 17:28
  • I just noticed you said this happens when you hit either server directly. I would think that means your load balancer is probably not the problem. Are you using the default session management (I believe it's inproc)? – Tim Aug 23 '13 at 17:29
  • @Tim: It's default session management. – Invalid Character Aug 23 '13 at 17:30
  • Have you tried changing to use the ASP.Net State Server or Storing Session in the Database then. Won't br pretty if you session objects are not streamable, but if so, might be a simple fix. – Gary Walker Aug 23 '13 at 18:10
  • Default session is cookie based. Maybe your cookie on the client is getting deleted on you for some reason? – Tim Aug 26 '13 at 12:03
  • I took the image out of session and made the session SQL based - it seemed to have cut the error rate from about 15% to about 0.07%. While I consider it close enough to working, I'd still love to find out the root cause. - note that with more tested and logging, we've noticed that sessions were being overwitten by previous copies of that particular session. – Invalid Character Aug 26 '13 at 17:50

0 Answers0