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

Overload of GetAndLockAsync causes stack overflow exception

    XMLWordPrintable

    Details

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

      Description

      {{ public Task<IOperationResult<T>> GetAndLockAsync<T>(string key, TimeSpan expiration, TimeSpan timeout) { return GetAndLockAsync<T>(key, expiration, timeout); }}}

      This is a recursive call > stackoverflow (in .Net Core, it doesn't even crash nicely in unit tests)
      To avoid it you should do something like

      {{ public Task<IOperationResult<T>> GetAndLockAsync<T>(string key, TimeSpan expiration, TimeSpan timeout) { return GetAndLockAsync<T>(key, (uint)expiration.TotalSeconds, timeout); }}}

      https://github.com/couchbase/couchbase-net-client/blob/master/Src/Couchbase/CouchbaseBucket.cs#L1521

        Attachments

        For Gerrit Dashboard: NCBC-1695
        # Subject Branch Project Status CR V

          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.