Details
-
Improvement
-
Resolution: Won't Fix
-
Major
-
3.2.4
-
None
-
1
-
SDK20: Pathfinding + Wrappers
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
- duplicates
-
NCBC-3067 GetAndLockAsync times out instead of throwing DocumentLockedException
- Resolved