Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
Description
From the forums: https://forums.couchbase.com/t/couchbase-session-state-provider-with-webform/3471
I'm currently working on session sharing between two applications: ASP.Net WebForm vs ASP.Net MVC.
Couchbase is one of the solutions. So, I'm trying to make a proof of concept.
I'm using Couchbase Server Enterprise 3.0.3 and the provider that can be found on github (https://github.com/couchbaselabs/couchbase-aspnet).
With MVC, it worked like a charm.
But, with WebForm, it fails when I try to add value on session (a simple string).
w3wp.exe take CPU: 25%, RAM: ~80Mo (>1% and >30Mo for MVC).
The problem is there:
namespace: Couchbase.AspNet.SessionState
class: SessionStateItem
method: Save(IMemcachedClient client, string id, bool metaOnly, bool useCas)
bool retval = useCas
? client.Cas(StoreMode.Set, HeaderPrefix + id, new ArraySegment(ms.GetBuffer(), 0, (int)ms.Length), ts, HeadCas).Result
: client.Store(StoreMode.Set, HeaderPrefix + id, new ArraySegment(ms.GetBuffer(), 0, (int)ms.Length), ts);
The client.Store() method always returns false.
As the Save() method is called in a while loop...it become a infinite loop...
} while (!e.Save(client, id, false, exclusiveAccess && !newItem));
So, I've investigate a little bit.
Couchbase.AspNet use couchbase-net-client v1.3.6.
I've included Enyim.Caching & Couchbase in my project to find what was going on.
The problem is in Couchbase.CouchbasePool, method IMemcachedNode IServerPool.Locate(string key).
This line in particular: this.state.Locator.Locate(key);
With MVC, the type of Locator is Enyim.Caching.Memcached.VBucketNodeLocator.
But with WebForm, it's Couchbase.CouchbasePool.NotFoundLocator...
But when it's initialized, it's a VBucketNodeLocator...
I can't find where this.state.Locator is modified.
Is there something I miss?
Is there a newer version?
You can find my solution here
Thanks.