-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Hi.
Recently in my production environment all the machines stopped sending/receiving messages via DotNetMQ. One machine had following exception in logs:
WARN 2018-04-12 15:18:25,028 [22 ] MDS.Communication.MDSRemoteApplication - Collection was modified after the enumerator was instantiated.
System.InvalidOperationException: Collection was modified after the enumerator was instantiated.
at System.Collections.Generic.LinkedList`1.Enumerator.MoveNext()
at MDS.Communication.MDSRemoteApplication.MessageDeliverer.AsynchronMessageControlTimer_Elapsed(Object state)
This happened 3 to 4 times recently and every time one machine has above Dotnetmq logs. The setup is point-to-point in-memory non-persistent.
I checked the DotnetMQ code. Inside method MessageDeliverer.AsynchronMessageControlTimer_Elapsed(), there is a foreach loop trying to modify the collection which is causing this exception. Following is the extraction:
foreach (var connectedCommunicator in _remoteApplication._communicators)
{
...
//Send communicator to end of the _receiverCommunicators list.
_remoteApplication._communicators.Remove(connectedCommunicator);
_remoteApplication._communicators.AddLast(connectedCommunicator);
}
Can you please help to describe what this code is trying to achieve. Can you please also help fixing the above code.
Thanks
Abhishek
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels