[rabbitmq-discuss] RabbitMq client and AppDomain unload
Michael Klishin
mklishin at gopivotal.com
Thu May 22 09:46:47 BST 2014
On 22 May 2014 at 12:38:03, Dmitry Naumov (dmitry.naumov78 at gmail.com) wrote:
> > I have separate AppDomains (not primary) where I use RabbitMq.Client
> (RMQC). When I try to unload domain it seems like RMQC prevents
> to do it gracefully.
> ConnectionBase creates 2 _foreground_ threads which in case
> of absence of messages are blocked inside Socket.Receive and
> do not check external flags like m_running/m_closed.
> Yes, ConnectionBase has subscription to DomainUnload:
>
> AppDomain(http://127.0.0.1/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.AppDomain).CurrentDomain(http://127.0.0.1/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.AppDomain/property:CurrentDomain:System.AppDomain).DomainUnload(http://127.0.0.1/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.AppDomain/event:DomainUnload:System.EventHandler)
> += new EventHandler(http://127.0.0.1/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.EventHandler)(this.HandleDomainUnload(http://127.0.0.1/roeder/dotnet/Default.aspx?Target=code://RabbitMQ.Client:3.2.1.0:89e7d7c5feba84ce/RabbitMQ.Client.Impl.ConnectionBase/HandleDomainUnload(Object,System.EventArgs)));
>
> but it won't be called if any foreground threads prevent domain
> from unloading.
> It would be nice if all threads created inside ConnectionBase
> would have IsBackground set to true.
Dmitry,
Thanks for reminding, we have a bug filed for that.
I will try to look into it sooner .
--
MK
Software Engineer, Pivotal/RabbitMQ
More information about the rabbitmq-discuss
mailing list