Skip to content

IModel.Dispose() blocks if called from within the ConnectionShutdown event #154

@reisenberger

Description

@reisenberger

I am an EasyNetQ user assisting another EasyNetQ user on EasyNetQ/EasyNetQ#522 . The investigation of the issue within EasyNetQ seems clearly to point to the problem that IModel.Dispose() blocks if called from within the ConnectionShutdown event.

We note from 2012 correspondence
http://grokbase.com/t/rabbitmq/rabbitmq-discuss/128mwgvyvc/net-rabbitmq-client-issue-deadlock-on-connectionshutdown
http://grokbase.com/t/rabbitmq/rabbitmq-discuss/129maqaa6s/imodel-dispose-locks-if-called-during-connectionshutdown-event
... that Emile Joubert suggested:

The channel/IModel will be cleaned up by the library. There is no need
to do this from within the ConnectionShutdown event handler, and
attempting to do so will lead to the problems you describe.

Does this advice still apply? IE Should EasyNetQ stop calling Dispose() on IModels within the ConnectionShutdown handler?

Or should EasyNetQ follow advice in #49 ? , ie call .Close() on the IModel now, rather than .Dispose() ?

Thanks

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions