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

Tracing causes System.InvalidOperationException exception when waiting on GetDocumentsAsync<...>(keys);

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.6.0
    • 2.6.1
    • library
    • None
    • 1

    Description

      I’m trying to track down an issue that has appeared since I updated to the latest version of CouchBase 5.5, and the .NET client 2.6.

      var task = bucket.GetDocumentsAsync(keys);
      task.Wait();

      {System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
      at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
      at System.Collections.Generic.List{{1.Enumerator.MoveNextRare() at Couchbase.Tracing.SpanSummary.PopulateSummary(IEnumerable}}1 spans)
      at Couchbase.Tracing.SpanSummary…ctor(Span span)
      at Couchbase.Tracing.ThresholdLoggingTracer.ReportSpan(Span span)
      at Couchbase.Tracing.Span.Finish()
      at Couchbase.Core.Buckets.CouchbaseRequestExecuter.d_12{{1.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Couchbase.CouchbaseBucket.<GetDocumentAsync>d_76}}1.MoveNext()
      — End of stack trace from previous location where exception was thrown —
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Couchbase.CouchbaseBucket.d__76`1.MoveNext()}

      I’m in the process of rolling back the SDK back to 2.5.12 to verify it’s specific to the update, but wanted to see if anyone else has come across this.

      ------------------------2nd message below--------------------

      I was able to eliminate the issue by disabling tracing in .NET 2.6 SDK:

      var configuration = new ClientConfiguration(configurationSection);
      configuration.OperationTracingEnabled = false;
      Cluster cluster = new Cluster(configuration);

       

      Attachments

        Issue Links

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

          Activity

            jmorris Jeff Morris added a comment -

            Michael Goldsmith - assigned to you since you have been working on tracing. Looks like a collection was modified while be enumerated?

            jmorris Jeff Morris added a comment - Michael Goldsmith - assigned to you since you have been working on tracing. Looks like a collection was modified while be enumerated?

            The fix I have provided will prevent the exception from bubbling up but we still need to investigate why this is happening. I've created ticket NCBC-1745 to track the investigation of why spans are being added after the root span has finished.

            mike.goldsmith Michael Goldsmith added a comment - The fix I have provided will prevent the exception from bubbling up but we still need to investigate why this is happening. I've created ticket NCBC-1745 to track the investigation of why spans are being added after the root span has finished.

            People

              mike.goldsmith Michael Goldsmith
              jmorris Jeff Morris
              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