Description
If an operation cannot resolve its VBucket and is retried until failure, then a TaskCanceledException is thrown. The easiest way to replicate this is to build a cluster in docker and improperly map the ports so that bootstrapping succeeds but operations fail as they get sent to the wrong node.
Unhandled exception. System.Threading.Tasks.TaskCanceledException: A task was canceled.
|
at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync(BucketBase bucket, IOperation operation, CancellationTokenPair tokenPair) in /Users/jeffry.morris/Documents/source/couchbase-net-client/src/Couchbase/Core/Retry/RetryOrchestrator.cs:line 234 |
at Couchbase.KeyValue.CouchbaseCollection.UpsertAsync[T](String id, T content, UpsertOptions options) in /Users/jeffry.morris/Documents/source/couchbase-net-client/src/Couchbase/KeyValue/CouchbaseCollection.cs:line 636 |
at KvLoad.Program.Main(String[] args) in /Users/jeffry.morris/Documents/source/sandbox/KvLoad/Program.cs:line 41 |
at KvLoad.Program.<Main>(String[] args)
|
To reproduce, build a cluster using docker-compose.yaml and then improperly map the ports:
couchbase-cli setting-alternate-address -c localhost:8091 --username Administrator --password asdasd --set --node cb1.lan --hostname mbp.local --ports mgmt=9091,kv=11211; |
|
couchbase-cli setting-alternate-address -c localhost:8091 --username Administrator --password asdasd --set --node cb2.lan --hostname mbp.local --ports mgmt=9092,kv=11211; |
|
couchbase-cli setting-alternate-address -c localhost:8091 --username Administrator --password asdasd --set --node cb3.lan --hostname mbp.local --ports mgmt=9093,kv=11211; |
And then set the hosts file to point localhost to something like mbp.local. This will confuse the SDK and produce 3 nodes that point to "mbp.local:11211" as opposed to
a["mbp.local:11211", "mbp.local:11212", "mbp.local:11213"] and generate NMVBs that lead to TaskCancellationException instead of a TimeoutException.