atheken/NoRM

endless busy loop when primary mongod are going down.

Opened this issue · 0 comments

There is a busy loop in the source code which may result in an infinite loop.

namespace Norm.Protocol.Messages
{
...
public ReplyMessage Execute()
{
...
var stream = _connection.GetStream();
while (!stream.DataAvailable)
{
Thread.Sleep(1);
}
...

When you shut down the mongod primary the property stream.DataAvailable will always return false and there is no Exception being thrown. So when you shut down the primary mongod (and another gets primary), this source code results in an infinite busy loop.