GetAndLockAsync times out instead of throwing DocumentLockedException

Description

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) in C:\Users\X\source\couchbase-net-client\src\Couchbase\Utils\ThrowHelper.cs:line 83 at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync(BucketBase bucket, IOperation operation, CancellationTokenPair tokenPair) in C:\Users\X\source\couchbase-net-client\src\Couchbase\Core\Retry\RetryOrchestrator.cs:line 243 at Couchbase.KeyValue.CouchbaseCollection.UpsertAsync[T](String id, T content, UpsertOptions options) in C:\Users\X\source\couchbase-net-client\src\Couchbase\KeyValue\CouchbaseCollection.cs:line 559 at Couchbase.CombinationTests.KeyValueTests.Test_GetAndLockAsync() in C:\Users\X\source\couchbase-net-client\tests\Couchbase.CombinationTests\KeyValueTests.cs:line 143

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:

Jeffry Morris June 3, 2022 at 8:20 PM

This is behavior is expected. Too override this behavior a custom retry strategy can be created: https://forums.couchbase.com/t/detecting-locked-document-with-java-sdk-3/32775

https://couchbasecloud.atlassian.net/browse/NCBC-3228#icft=NCBC-3228 was added to make it easier to duplicate and override the behavior of the BestEffortRetryStrategy.

Jeffry Morris December 23, 2021 at 2:29 AM

It appears that this is the expected behavior at least as defined in the RFC: https://github.com/couchbaselabs/sdk-rfcs/blob/master/rfc/0049-sdk3-retry-handling.md#response-code-retry-list

By default, once a complete, known response is received it should not be retried, unless specifically outlined in this list.
...

Locked 0x09 (Reason: KV_LOCKED)

Note: do NOT retry on KV_LOCKED for the "Unlock" command (the retry handler should never see it in the first place!( Reason is that this needs to be surfaced as a cas mismatch exception to the user and not being retried
...

Won't Fix
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Components

Sprint

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created December 22, 2021 at 8:12 PM
Updated June 3, 2022 at 8:20 PM
Resolved June 3, 2022 at 8:20 PM
Instabug