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

.Net Web App via C# driver reports connection problems

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.1
    • Affects Version/s: 1.1
    • Component/s: None
    • Environment:
      Windows Server 2008R2 Datacenter (EC2) running IIS7

      Two symptoms, potentially linked:

      • Specific server in a farm of identical machines generates errors, apparently one per second It is logged Via elmah as:
        System.TimeoutException: Timeout waiting for a MongoConnection.
        at MongoDB.Driver.Internal.MongoConnectionPool.AcquireConnection(MongoDatabase database)
        at MongoDB.Driver.MongoServerInstance.AcquireConnection(MongoDatabase database)
        at MongoDB.Driver.MongoServer.AcquireConnection(MongoDatabase database, Boolean slaveOk)
        at MongoDB.Driver.MongoCursorEnumerator`1.AcquireConnection()
        at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst()
        at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext()
        at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
        at MongoDB.Driver.MongoCollection.FindOneAs[TDocument](IMongoQuery query)
        at MongoDB.Driver.MongoCollection`1.FindOne(IMongoQuery query)
        at MongoDB.Driver.MongoDatabase.RunCommandAs(Type commandResultType, IMongoCommand command)
        at MongoDB.Driver.MongoDatabase.RunCommandAs[TCommandResult](IMongoCommand command)
        at MongoDB.Driver.MongoDatabase.RunCommand(IMongoCommand command)
        at MongoDB.Driver.MongoCollection.Count(IMongoQuery query)

      This is resolved by resetting the app-pool for that site on that host. No specific trigger is found on the servers themselves in either the mongodb.log files nor from other system monitoring tools.

      • Some time later (30 minutes)all servers in the pool (of 6) begin logging:
        System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
        at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
          • End of inner exception stack trace —
            at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
            at MongoDB.Bson.IO.BsonBuffer.LoadFrom(Stream stream, Int32 count)
            at MongoDB.Bson.IO.BsonBuffer.LoadFrom(Stream stream)
            at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinaryReaderSettings readerSettings, IBsonSerializationOptions serializationOptions)
            at MongoDB.Driver.MongoCursorEnumerator`1.GetReply(MongoConnection connection, MongoRequestMessage message)
            at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst()
            at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext()
            at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
            at MongoDB.Driver.MongoCollection.FindOneAs[TDocument](IMongoQuery query)
            at MongoDB.Driver.MongoCollection`1.FindOne(IMongoQuery query)
            at MongoDB.Driver.MongoDatabase.RunCommandAs(Type commandResultType, IMongoCommand command)
            at MongoDB.Driver.MongoDatabase.RunCommandAs[TCommandResult](IMongoCommand command)
            at MongoDB.Driver.MongoDatabase.RunCommand(IMongoCommand command)
            at MongoDB.Driver.MongoCollection.Count(IMongoQuery query)

      This is again resolved by an app-pool reset.

      In both cases the evidence points more to the driver, however we would like to know how to go about directing ourselves in one direction or another. A problem local to one server doesn't feel like a server issues, however a problem shared among several could be.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            dpinkard@woot.com Dan Pinkard
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: