-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CacheServiceTicketManager cleanup issues #41
Comments
@sunnymoon this could be solved by the RFC for a distributed cache provider in issue #61, correct? I think any time you use an in-memory cache, such as System.Web.Caching or System.Runtime.Caching, you are going to run into the possibility of IIS recycling the app pool. The in-memory caching just isn't durable.... there is no serialization to disk. I guess another possibility is making a cache provider for the proxy and service ticket managers that is in-memory, but also serializes to local disk for durability. Any chance you'd be up for writing that? |
@phantomtypist I don't think backing up in-memory to file is good idea. It will require significant efforts to implement it in a good way (like support multithreading, possible issues with file read/write, issues with network drives etc), and it still won't work in distributed environments, like scale up in Azure etc. There are many ways which will lead to in-memory cache cleanup, so I think it would be just good to emphasize that default (and the only) implementation of cache is in-memory. Actually it is even commented in source code here https://github.com/apereo/dotnet-cas-client/blob/master/DotNetCasClient/State/CacheProxyTicketManager.cs#L27 in
I think highlighting it in the repository readme to warn users is really good idea. For real-life production cases something like in-memory cache + database can be useful, but that is really part of #61 IMO. |
I'll be finalizing the 1.1.0 release today and at the same time cleaning up a bit of the documentation on the readme. I'll add a note for that. Some of the content from the readme will be migrated to the GitHub wiki in this repo too. I'm going to close this issue as the in-memory caching is working by design (in .NET, that is.) If anybody wants a scenario where the tickets survive an IIS or AppPool recycle, then they'll have to use the option(s) eventually created by issue #61. |
We've implemented an alternative with a static global variable. The reallity is if the application pool gets recicled we'll loose all logged in session, true. But actually the webcache is actually cleared by .net at any point in time, nevermind the pool recycling. It depends only on memory pressure and not memory exhaustion... For additional details... |
When the memory pressure is hig on the HttpContext.Current.Cache, it gets cleared by IIS. Then the user is actually "logged out" in the middle of an otherwise authenticated session.
Implementing the storage of local tickets on the HttpContext Cache seems flawed by design, since collection of items might not be totally controlled.
The text was updated successfully, but these errors were encountered: