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

Correct issue in bucket reference counting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.3
    • Component/s: library
    • Labels:
      None

      Description

      When giving out a reference to a cached bucket, the ClusterController was not adding a new reference to the bucket.

      https://github.com/couchbase/couchbase-net-client/pull/58

      However, simply adding a new reference would not be sufficient. Disposing of the bucket is handled by the bucket itself, and while the bucket does call DestroyBucket on its associated ClusterController, thus removing the bucket from the cache, there is no shared locking mechanism. So it is entirely possible that in the ClusterController, between the ContainsKey call and the _buckets[bucketName] call, the bucket could become disposed.

      Therefore, AddRef was changed to check the _disposed value and return -1 if the bucket is disposed. It can be used as an atomic add-or-fail operation by the ClusterController. Once the ClusterController finds a bucket in its cache, it will attempt to add the reference before returning the cached bucket. If the add reference fails, it will bootstrap a new bucket.

        Attachments

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

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              jmorris Jeff Morris
              Reporter:
              jmorris Jeff Morris
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.