Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-2342

Couchbase.IO.SharedConnectionPools.Acquire sometimes throws IndexIndexOutOfRangeException

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.15
    • 2.7.16
    • library
    • None
    • 1

    Description

       Exception Type: System.IndexOutOfRangeException
      Stack trace:

       at System.Collections.Generic.List`1.get_Item(Int32 index)
       at System.Linq.Enumerable.ElementAtOrDefault[TSource](IEnumerable`1 source, Int32 index)
       at Couchbase.IO.SharedConnectionPool`1.Acquire()
       at Couchbase.IO.Services.PooledIOService.Execute[T](IOperation`1 operation)
       at Couchbase.Core.Server.Send[T](IOperation`1 operation)

       

      Our application encounters this fairly frequently. Up to tens of thousands of times per day. The method of selecting the index of the connection doesn't seem to be working in all cases.

      _connections.ElementAtOrDefault(GetIndex())
      

      A comment in GetIndex() states " we don't care necessarily about thread safety..." , but that approach isn't working so well. Sometimes it gets the wrong index.

      As a workaround we will retry the request.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          jmorris Jeff Morris added a comment - - edited

          Nathan Johnson -

          This has been reported before and is related to NCBC-2148; it has been reported that removing this commit fixes the problem. We will put out a new build 2.7.16 with NCBC-2148 removed sometime in the near future. For now, I would suggest reverting to 2.7.13 2.7.12 which is the release before NCBC-2148 was committed.

          Thanks for reporting,

          -Jeff

          jmorris Jeff Morris added a comment - - edited Nathan Johnson - This has been reported before and is related to NCBC-2148 ; it has been reported that removing this commit fixes the problem. We will put out a new build 2.7.16 with NCBC-2148 removed sometime in the near future. For now, I would suggest reverting to 2.7.13 2.7.12 which is the release before NCBC-2148 was committed. Thanks for reporting, -Jeff

          Jeff Morris I just checked and I was wrong about which version this affected. It's happening in 2.7.13. We were using 2.7.15 in DEV but this issue is happening on 2.7.13 in production.
          It looks like NCBC-2148 was marked as fixed in 2.7.13.
          Should we revert to 2.7.12?

          njohnson@netdocuments.com Nathan Johnson added a comment - Jeff Morris  I just checked and I was wrong about which version this affected. It's happening in 2.7.13. We were using 2.7.15 in DEV but this issue is happening on 2.7.13 in production. It looks like NCBC-2148 was marked as fixed in 2.7.13. Should we revert to 2.7.12?
          jmorris Jeff Morris added a comment -

          Yes, that was a mistake!

          jmorris Jeff Morris added a comment - Yes, that was a mistake!
          jmorris Jeff Morris added a comment - Reverted http://review.couchbase.org/c/121691/

          People

            jmorris Jeff Morris
            njohnson@netdocuments.com Nathan Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty