{"issue":{"created_at":"2011-09-05T19:59:22Z","state":"closed","updated_at":"2011-12-12T22:03:25Z","comments":2,"user":{"gravatar_id":"43044c02fb1b868afb34ede6f4fdb0bc","id":1028240,"url":"https://api.github.com/users/joel100","avatar_url":"https://secure.gravatar.com/avatar/43044c02fb1b868afb34ede6f4fdb0bc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"joel100"},"body":"Hi \r\n\r\nI've just started playing with CouchBase 2.0 and the EnyimMemcached library. I'm loving the performance but I'm hitting the null reference exception below.\r\n\r\nThis is the code I've been playing with. I can also get the same exception if I run the MembaseClient in a straight for loop for a large number of iterations. \r\n\r\nclass Program\r\n    {\r\n        const string keyMap = \"Key_{0}_{1}\";\r\n\r\n        static void Main(string[] args)\r\n        {           \r\n            ParallelOptions options = new ParallelOptions { MaxDegreeOfParallelism = 6 };\r\n            Parallel.For(0, 100000, options, x => Write(x));\r\n            Console.ReadKey();\r\n        }\r\n\r\n        private static void Write(int x)\r\n        {\r\n            using (MembaseClient client = new MembaseClient())\r\n            {\r\n                for (int y = 0; y <= 100000; y++)\r\n                {                    \r\n                    //client.Remove(string.Format(keyMap, x, y));\r\n                    client.Store(Enyim.Caching.Memcached.StoreMode.Add, string.Format(keyMap, x, y), DateTime.Now);\r\n                    //DateTime it = client.Get<DateTime>(\"Map_0_0\");                    \r\n                }\r\n            }\r\n\r\n            Console.WriteLine(\"{0}, {1}\", x, DateTime.Now);\r\n        \r\n        }\r\n    }\r\n\r\nAnd the exception stack trace\r\n\r\n   at Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl.ReleaseSocket(PooledSocket socket) in C:\\dev\\couchbase-net-client\\libs\\EnyimMemcached\\Enyim.Caching\\Memcached\\MemcachedNode.cs:line 373\r\n   at Enyim.Caching.Memcached.PooledSocket.Dispose(Boolean disposing) in C:\\dev\\couchbase-net-client\\libs\\EnyimMemcached\\Enyim.Caching\\Memcached\\PooledSocket.cs:line 157\r\n   at Enyim.Caching.Memcached.PooledSocket.System.IDisposable.Dispose() in C:\\dev\\couchbase-net-client\\libs\\EnyimMemcached\\Enyim.Caching\\Memcached\\PooledSocket.cs:line 163\r\n   at Enyim.Caching.Memcached.MemcachedNode.ExecuteOperation(IOperation op) in C:\\dev\\couchbase-net-client\\libs\\EnyimMemcached\\Enyim.Caching\\Memcached\\MemcachedNode.cs:line 480\r\n   at Enyim.Caching.Memcached.MemcachedNode.Enyim.Caching.Memcached.IMemcachedNode.Execute(IOperation op) in C:\\dev\\couchbase-net-client\\libs\\EnyimMemcached\\Enyim.Caching\\Memcached\\MemcachedNode.cs:line 532\r\n   at Membase.MembaseClient.ExecuteWithRedirect(IMemcachedNode startNode, ISingleItemOperation op) in C:\\dev\\couchbase-net-client\\libs\\EnyimMemcached\\Membase\\MembaseClient.cs:line 198\r\n   at Membase.MembaseClient.PerformStore(StoreMode mode, String key, Object value, UInt32 expires, UInt64& cas, Int32& statusCode) in C:\\dev\\couchbase-net-client\\libs\\EnyimMemcached\\Membase\\MembaseClient.cs:line 181\r\n   at Enyim.Caching.MemcachedClient.Store(StoreMode mode, String key, Object value) in C:\\dev\\couchbase-net-client\\libs\\EnyimMemcached\\Enyim.Caching\\MemcachedClient.cs:line 204\r\n   at CouchBaseTest.Program.Write(Int32 x) in c:\\dev\\CouchBaseTest\\CouchBaseTest\\Program.cs:line 29\r\n   at CouchBaseTest.Program.<Main>b__1(Int32 x) in c:\\dev\\CouchBaseTest\\CouchBaseTest\\Program.cs:line 18\r\n   at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.<ForWorker>b__c()","assignee":null,"number":80,"id":1573060,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"NullReferenceException in Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl.ReleaseSocket(PooledSocket socket)","html_url":"https://github.com/enyim/EnyimMemcached/issues/80","closed_at":"2011-12-12T22:03:25Z","url":"https://api.github.com/repos/enyim/EnyimMemcached/issues/80","milestone":null},"action":"closed"}