Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2543

An exception occurred while receiving a message from the server

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.7.0
    • Environment:
      windows, console application, .net framework 4.7.2

      We are running simultaneously approx. 15-16 instances of a tool (we wrote), which sometimes are throwing the following error messages by a read operation:

      2019-03-13 00:02:59 An exception occurred while receiving a message from the server.
       MongoDB.Driver.Core
       ReceiveBuffer
       at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer()
       at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer(Int32 responseTo, CancellationToken cancellationToken)
       at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveMessage(Int32 responseTo, IMessageEncoderSelector encoderSelector, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)
       at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquiredConnection.ReceiveMessage(Int32 responseTo, IMessageEncoderSelector encoderSelector, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)
       at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)
       at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)
       at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocol[TResult](IWireProtocol`1 protocol, CancellationToken cancellationToken)
       at MongoDB.Driver.Core.Servers.Server.ServerChannel.Command[TResult](ICoreSession session, ReadPreference readPreference, DatabaseNamespace databaseNamespace, BsonDocument command, IEnumerable`1 commandPayloads, IElementNameValidator commandValidator, BsonDocument additionalOptions, Action`1 postWriteAction, CommandResponseHandling responseHandling, IBsonSerializer`1 resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)
       at MongoDB.Driver.Core.Operations.AsyncCursor`1.ExecuteGetMoreCommand(IChannelHandle channel, CancellationToken cancellationToken)
       at MongoDB.Driver.Core.Operations.AsyncCursor`1.GetNextBatch(CancellationToken cancellationToken)
       at MongoDB.Driver.Core.Operations.AsyncCursor`1.MoveNext(CancellationToken cancellationToken)
       at MongoDB.Driver.Core.Operations.AsyncCursorEnumerator`1.MoveNext()
      

      In the collection we have 74160665 docs (avg. doc size 1.7KB). The query uses a multikey compound index with 5 fields (string, bool, bool, bool, array) and we are using projection to acquire the _id and a string type field. Our cluster consists of 3 data-bearing nodes and we use nearest readPreference. Some of the other tool instances are making writes on this collection parallel. The method which makes the read operation is executed in a synchronous fashion, and we tried to read the results into a cursor.
      What could cause this behavior? If more info is needed I will try to provide it.

      Sorry for the previous posting (2542), I accidentally pressed the enter key.

            Assignee:
            wan.bachtiar@mongodb.com Wan Bachtiar
            Reporter:
            mitereiter@gmail.com Mitereiter Balazs Zoltan
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: