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

Validate: Document accessed after Locking should raise DocumentLockedException or Timeout?

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Fix
    • Major
    • 3.3.2
    • 3.2.4
    • None

    Description

       

      class Program
       {
       static async Task Main(string[] args)
       {
       try
       {
          var cluster = await Couchbase.Cluster.ConnectAsync("couchbase://localhost",      "Administrator", "password");
          var bucket = await cluster.BucketAsync("travel-sample");
          var scope = await bucket.ScopeAsync("inventory");
          var coll = await scope.CollectionAsync("airport");
          var key = "airport-500001";
          var document = new { id=500001, type = "airport", airportname = "Francis     Airport", Country = "France" };
       
          await coll.UpsertAsync<dynamic>(key, document);
          await coll.GetAndLockAsync(key, TimeSpan.FromSeconds(30));
          await coll.RemoveAsync(key);
      }
      catch (CouchbaseException ex)
      {
         Console.WriteLine(ex); 
      }
      catch (Exception ex)
      {
          Console.WriteLine(ex); 
      }
      Console.Read();
      }
      }
      

      In the code above, attempt to remove a document thats being locked should raise a DocumentLockedException instead a AmbiguousTimeoutException is raised

       

      Couchbase.Core.Exceptions.AmbiguousTimeoutException: The operation /25 timed out after 00:00:02.5000000. It was retried 10 times using Couchbase.Core.Retry.BestEffortRetryStrategy.
       at Couchbase.Utils.ThrowHelper.ThrowTimeoutException(IOperation operation, IErrorContext context)
       at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync(BucketBase bucket, IOperation operation, CancellationTokenPair tokenPair)
       at Couchbase.KeyValue.CouchbaseCollection.RemoveAsync(String id, RemoveOptions options)
       at ScopeLevelQuery.Program.Main(String[] args) in /Users/arun.vijayraghavan/ScopeLevelQuery/ScopeLevelQuery/Program.cs:line 47

       

      Attachments

        Issue Links

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

          Activity

            People

              jmorris Jeff Morris
              arun.vijayraghavan Arun Vijayraghavan (Inactive)
              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