Connection drops and won't recover, fixed by going back to 2.1.18

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • 2.1.21
    • Affects Version/s: 2.1.20
    • Component/s: None
    • Environment:
      Node js on amazon
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Okay, I updated to the latest driver and it really caused issues for me. I have no idea what is going on but will describe the situation.

      I have a collection for logging called "main". In my application I create two connections. I do this because in production I have "main" on a separate db.

      Basically, what happens is when I first start my application I can query my logs doing this:

      this.logConn('main', function (err, collection) {
      console.log('collection', collection.s.name);
      collection.find(findObject)
      .sort(

      {ts: -1}

      )
      .skip(skip)
      .limit(limit)
      .toArray(function(err, docs)

      { console.log('HERE'); callback(false, docs ); }

      );
      });

      Then after about 3 minutes of not being used (this seems important, if I sit this and refresh the web page that causes the query it seems to keep working), after I come back, it stops working. I never get anything back, even an error. After enabling error logging on the drover this is what I get:

      Connection 1464375720617
      connection 3 for [ds043220.mongolab.com:43220] timed out
      Pool 1464375720617
      pool [undefined] timed out [

      {"name":"MongoError","message":"connection 3 to ds043220.mongolab.com:43220 timed out"}

      ] with connection [

      {"id":3,"host":"ds043220.mongolab.com","port":43220}

      ]
      Server 1464375720617
      Connection 1464375720618
      connection 3 with for [ds043220.mongolab.com:43220] closed
      Pool 1464375720618
      pool [undefined] closed [

      {"name":"MongoError","message":"connection 3 to ds043220.mongolab.com:43220 closed"}

      ] with connection [

      {"id":3,"host":"ds043220.mongolab.com","port":43220}

      ]
      Connection 1464375721619
      creating connection 4 with options [

      {"host":"ds043220.mongolab.com","port":43220,"size":5,"connectionTimeout":120000,"socketTimeout":120000}

      ]
      Server 1464375721622

      It shows in the logs that it reconnects BUT every time I query with this connection it does the same thing. It's unusable until I restart the service.

      I switched back to 2.1.18 (becaues that seemed like the last major release) and it works just fine.

      This only happens when querying this single collection. This collection has a lot of very LARGE records, I wonder if that is related. It's also one of the few collections I do a sort, skip, and limit on too.

            Assignee:
            Christian Amor Kvalheim
            Reporter:
            Clark Endrizzi
            None
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: