Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

When performing MultiGet, unloading AppDomain crashes the host #103

Closed
onyxmaster opened this Issue Apr 19, 2012 · 4 comments

Comments

Projects
None yet
6 participants

This is due to EventWaitHandles already being destroyed, and mre.Set() being called in a finally block -- it leads to unhandled ObjectDisposedException that kills the host application (IIS pool in our case). Encasing mre.Set() with try/catch(ObjectDisposedException) block in async callbacks (MultiGet, Stats, maybe in other places) should alleviate this problem.

vchekan commented Jun 5, 2012

I have the same issue.

We have the same issue. As the following code fragment in 'PerformMultiGet' executes on a ThreadPool thread, there is no way for an application to recover from this.

...
finally
{
manualResetEvent.Set();
}
...

An edited crash report :

System.ObjectDisposedException was unhandled
Message="Safe handle has been closed"
Source="mscorlib"
ObjectName=""
StackTrace:
at System.StubHelpers.StubHelpers.SafeHandleC2NHelper(...)
at Microsoft.Win32.Win32Native.SetEvent(SafeWaitHandle handle)
at System.Threading.EventWaitHandle.Set()
at Enyim.Caching.MemcachedClient.<>c__DisplayClass14`1.b__11(IAsyncResult iar)
...
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(...)
...

hidori commented Apr 28, 2013

I have the same issue. too

We are going to fix this on the Couchbase fork of this project: http://www.couchbase.com/issues/browse/NCBC-198

@enyim enyim closed this Apr 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment