Description
The following code will cause an ObjectDisposedException to be thrown:
var cluster = await Cluster.ConnectAsync("localhost:11211", new ClusterOptions { Logging = loggerFactory, NetworkResolution = NetworkResolution.External }.WithCredentials("Administrator", "password"));await cluster.WaitUntilReadyAsync(TimeSpan.FromSeconds(10));var bucket = await cluster.BucketAsync("default"); bucket.Dispose();bucket = await cluster.BucketAsync("default");Console.WriteLine((await bucket.DefaultCollection().UpsertAsync("doc1", new { name = "poo" })).Cas); |
The exception:
System.ObjectDisposedException
|
HResult=0x80131622 |
Message=Cannot access a disposed object.
|
Object name: 'DataFlowConnectionPool'. |
Source=Couchbase.NetClient
|
StackTrace:
|
at Couchbase.Utils.ThrowHelper.ThrowObjectDisposedException(String objectName) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Utils\ThrowHelper.cs:line 54 |
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.EnsureNotDisposed() in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\IO\Connections\DataFlow\DataFlowConnectionPool.cs:line 221 |
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.SendAsync(IOperation operation, CancellationToken cancellationToken) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\IO\Connections\DataFlow\DataFlowConnectionPool.cs:line 97 |
at Couchbase.Core.ClusterNode.<>c.<ExecuteOp>b__127_0(IOperation op2, Object state, CancellationToken effectiveToken) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\ClusterNode.cs:line 646 |
at Couchbase.Core.ClusterNode.<ExecuteOp>d__125.MoveNext() in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\ClusterNode.cs:line 507 |
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
|
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
|
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
|
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
|
at Couchbase.CouchbaseBucket.<SendAsync>d__13.MoveNext() in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\CouchbaseBucket.cs:line 220 |
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
|
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
|
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
|
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
|
at Couchbase.Core.Retry.RetryOrchestrator.<RetryAsync>d__4.MoveNext() in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\Retry\RetryOrchestrator.cs:line 180 |
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
|
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
|
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
|
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
|
at Couchbase.KeyValue.CouchbaseCollection.<UpsertAsync>d__43`1.MoveNext() in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\KeyValue\CouchbaseCollection.cs:line 558 |
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
|
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
|
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
|
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() |
at ConsoleApp2.Program.<Main>d__0.MoveNext() in C:\Users\Jeff Morris\source\couchbaseV3-replica-errors\ConsoleApp2\Program.cs:line 37 This exception was originally thrown at this call stack: |
Couchbase.Utils.ThrowHelper.ThrowObjectDisposedException(string) in ThrowHelper.cs
|
Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.EnsureNotDisposed() in DataFlowConnectionPool.cs
|
Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.SendAsync(Couchbase.Core.IO.Operations.IOperation, System.Threading.CancellationToken) in DataFlowConnectionPool.cs
|
Couchbase.Core.ClusterNode.ExecuteOp.AnonymousMethod__127_0(Couchbase.Core.IO.Operations.IOperation, object, System.Threading.CancellationToken) in ClusterNode.cs
|
Couchbase.Core.ClusterNode.ExecuteOp(System.Func<Couchbase.Core.IO.Operations.IOperation, object, System.Threading.CancellationToken, System.Threading.Tasks.Task>, Couchbase.Core.IO.Operations.IOperation, object, Couchbase.Core.IO.Operations.CancellationTokenPair) in ClusterNode.cs
|
[External Code]
|
Couchbase.CouchbaseBucket.SendAsync(Couchbase.Core.IO.Operations.IOperation, Couchbase.Core.IO.Operations.CancellationTokenPair) in CouchbaseBucket.cs
|
[External Code]
|
Couchbase.Core.Retry.RetryOrchestrator.RetryAsync(Couchbase.Core.BucketBase, Couchbase.Core.IO.Operations.IOperation, Couchbase.Core.IO.Operations.CancellationTokenPair) in RetryOrchestrator.cs
|
[External Code]
|
...
|
[Call Stack Truncated]
|