Hi William, thanks for you help, it is much appreciated.
Yes we have two problems and they are related because problem 1 raises problem 2.
It’s hard to define “when and because” Bus was disposed. I can assure you that we don’t dispose it in no situation.
These are the common situations that I’ve experienced in different projects; I know that they miss a lot of details but it’s hard to extabilish what is happing during these “excalation of problems”.
RabbitMQ 3.2.4 Windows Service was up and running and the Audit queue contained a lot of messages: looking at the log of my endpoints I saw a lot of connection error to RabbitMQ (see the following image) and the UnityContainer of my Web Backend (which contained an instance of Bus) was disposed.
For one Customer we have the persistence configured with NServicebus.NHibernate on a Oracle Database: when the Oracle Database is not reachable (it is a common situation when the Customer does maintenace on its database), the UnityContainer of my Web Backend (which contained an instance of Bus) is disposed.
2017-11-06 13:52:37.848 ERROR NServiceBus Repeated failures when fetching timeouts from storage, endpoint will be terminated.
Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-12541: TNS: No listener —> OracleInternal.Network.NetworkException (0x80004005): ORA-12541: TNS: No listener —> System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 126.96.36.199:1521
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at OracleInternal.Network.TcpTransportAdapter.Connect(ConnectionOption conOption)
at OracleInternal.Network.OracleCommunication.DoConnect(String tnsDescriptor)
at OracleInternal.ServiceObjects.OracleConnectionImpl.Connect(ConnectionString cs, Boolean bOpenEndUserSession, CriteriaCtx criteriaCtx, String instanceName)
3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch) at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch) at OracleInternal.ConnectionPool.OracleConnectionDispenser3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, CriteriaCtx criteriaCtx)
at NServiceBus.TimeoutPersisters.NHibernate.TimeoutPersister.GetNextChunk(DateTime startSlice, DateTime& nextTimeToRunQuery) in C:\BuildAgent\work\5135de308b2f3016\src\NServiceBus.NHibernate\TimeoutPersisters\TimeoutPersister.cs:line 43
at NServiceBus.Timeout.Hosting.Windows.TimeoutPersisterReceiver.Poll(Object obj) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Timeout\Hosting\Windows\TimeoutPersisterReceiver.cs:line 90
For another Customer we have the persistence configured on RavenDB 3.5, and when it had an outage (at the moment i don’t have a log that shows the RavenDB problem), I saw the following error in a endpoint log and the UnityContainer of my Web Backend (which contained an instance of Bus) was disposed.
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: The following critical error was encountered by NServiceBus:
Repeated failures when fetching timeouts from storage, endpoint will be terminated.
NServiceBus is shutting down.
at System.Environment.FailFast(System.String, System.Exception)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
Ok, thanks. I’m waiting for your solution about Unity container dispose issue.