[rabbitmq-discuss] RabbitMQ .NET Client Bug - ModelBase.BasicCancel Always Throws An Exception

Matthias Radestock matthias at rabbitmq.com
Thu Nov 1 19:47:53 GMT 2012


Joe,

On 01/11/12 19:20, joefitzgerald wrote:
> I have run across an issue with ModelBase.BasicCancel which appears
> to be a defect. The following statement always throws
> a NullReferenceException here:
> http://hg.rabbitmq.com/rabbitmq-dotnet-client/file/0037c3b3fa8d/projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs#l1135.
>
> The 'k' object is instantiated here:
> http://hg.rabbitmq.com/rabbitmq-dotnet-client/file/0037c3b3fa8d/projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs#l1117, and
> it appears that k.m_consumer is never initialized (nor can it
> be), leading to the null reference exception.

k.m_consumers gets set in HandleBasicCancelOk to 
m_consumers[consumerTag], which is also what releases the continuation, 
causing k.GetReply() to return.

So if you see a null reference exception there then somehow the 
continuation must have been released elsewhere, or 
m_consumers[consumerTag] was null when the rpc reply arrived. Which is odd.

So I'm afraid the problem is more subtle than it first appears.

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list