I'm a big fan of the ASP.NET State Service for managing sessions. InProc Sessions in ASP.NET are just too volatile due to the fact that any touches of web.config or IIS initiated process recycles can cause the application to restart taking down any active InProc Sessions with it. The ASP.NET State Server addresses these shortcomings with a Session service that is accessed externally to the ASP.NET/IIS Application Pool worker process, so it can survive ASP.NET application restarts. It works over TCP/IP so it's also possible to use a single State Server with multiple machines running in a WebFarm.
However, I've been noticing that the State Service is somewhat flakey in a number of situations. Specifically it appears that the service takes a bit of time to fire up where ASP.NET is up and running taking requests, but the state service is still initializing. I've seen more than a few ASP.NET applications fail on the first few hits that occur against the application with a session error. This error will go away after a few seconds after the State Service apparently has stabilized. The State Service Session doesn't handle this terribly gracefully. This problem seems to be isolated when traffic is fairly heavy on startup of the server.
Today I had another problem that was way more serious: The state server failed outright and shut down my Web applications on the server. My error logs pointed at Session problems, so I figured the service crashed. But it was running fine. I recycled the service but it still kept on failing. The service appears to be running, but it doesn't seem to be accepting connections even after a Stop and Restart of the service. Page request sit and hang for a while before failing with a Session error.
My temporay quick fix to isolate the problem was to switch the apps into InProc Sessions which made them run again immediately. I Eventually I ended up rebooting the machine and now the State Service works properly again.
Anybody else seeing this sort of behavior? I've seen this behavior both in my online apps as well as in the dev environment but it's very inconsistent and not reproducible. One of my apps has been having occasional odd hanging problems that I hadn't been able to trace down and now I'm wondering whether this is the same sort of problem occurring...
What would cause the State Service to get corrupted and stop taking incoming connections. Even after restarting it?