NServiceBus callback failure

Posted on October 22, 2010 · 1 min read · tagged with: #architecture

Today I found a bug in NServiceBus, which occured just before publishing our project. I isolated the bug, and published the unit test on the SourceForge, but I’m not quite sure whether the project is still alive (there are a few tickets untouched). The link to the isolated case: http://sourceforge.net/tracker/?func=detail&atid=1009068&aid=3092090&group_id=209277

The problem is a race condition which can occur when the service using Reply, replies before the callback is registered to the message. The scenario is simple: the reply message correlation id is not found in the dictionary and the message is consumed with no trace left. The callback registration occurs after this and hence, it will never be fired at all. Sad but true: this eliminates NServiceBus’ synchronous way to go.

It seems that for now, I cannot use callbacks at all (replying with messages handled by handlers works perfectly since it does not use this ‘correlation stuff’). Worth to notice, that I’ve got to redo a lot of work because of this ‘feature’.

Any thoughts about that?


Comments

The Source Forge repository is no longer used as they moved to github.

https://github.com/NServiceBus

by sanosdole at 2011-04-11 21:17:50 +0000

Yes, I've noticed a while ago. I've sent this information directly to Udi and it was discussed on it's group a week after the test was published (http://tech.dir.groups.yahoo.com/group/nservicebus/message/9041). The way to deal with this is to not use this 'feature' at all.

by scooletz at 2011-04-12 20:03:10 +0000