Possible race condition - System.InvalidOperationException: Queue empty ----------------------------------------------------------------------- Key: AMQNET-359 URL: https://issues.apache.org/jira/browse/AMQNET-359 Project: ActiveMQ .Net Issue Type: Bug Components: NMS Affects Versions: 1.5.1 Reporter: Frank Gynnild Assignee: Jim Gomes Priority: Critical Before and after we run unit tests, we use the SessionUtil.DeleteQueue(session, destination) to be sure that the state is correct, but quite often we get this exception: Unhandled exception in remote appdomain: System.InvalidOperationException: Queue empty. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.Queue`1.Dequeue() at Apache.NMS.ActiveMQ.Threads.ThreadPoolExecutor.QueueProcessor(Object unused) in :line 0 at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira