Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2976

InvalidOperationException: Collection was modified in GraphBinary serialization

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5.6, 3.6.4
    • 3.5.8, 3.6.6, 3.7.1
    • dotnet
    • None

    Description

      This was first reported for JanusGraph.Net: https://github.com/JanusGraph/janusgraph-dotnet/issues/140

      but the issue is most likely in Gremlin.Net.

      System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
        at System.Collections.Generic.Dictionary2.KeyCollection.Enumerator.MoveNext()  
        at Gremlin.Net.Structure.IO.GraphBinary.TypeSerializerRegistry.GetSerializerFor(Type valueType)
        at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryWriter.WriteAsync(Object value, Stream stream, CancellationToken cancellationToken)
      [...]

      The problem is most likely that the driver iterates over all supported types in a foreach loop to find a type to which the type to be serialized can be assigned which means that the same serializer can be used. Then this serializer is registered for the new type which modifies the collection the foreach is iterated on, leading to this error.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            florianhockmann Florian Hockmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment