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

Gremlin.Net.Driver.Connection.Parse throws a NullReferenceException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4.1
    • Fix Version/s: 3.5.0, 3.4.7
    • Component/s: dotnet
    • Labels:
      None

      Description

      The Parse method has only three objects on which we call methods of which two are readonly. So the problem is most likely in the error handling:

      if (_callbackByRequestId.TryRemove(receivedMsg.RequestId, out var responseHandler))
       {
           responseHandler.HandleFailure(e);
      }
       

      Here, responseHandler can be null if the callback handler for that request id was not found. So we just need a null check. (We can't notify anyone about a failure any way in this case.)

      Stack trace:

      System.NullReferenceException: Object reference not set to an instance of an object.
         at Gremlin.Net.Driver.Connection.Parse(Byte[] received)
         at Gremlin.Net.Driver.Connection.ReceiveMessagesAsync()
         at Gremlin.Net.Driver.ProxyConnection.SubmitAsync[T](RequestMessage requestMessage)
         at Gremlin.Net.Driver.GremlinClient.SubmitAsync[T](RequestMessage requestMessage)
         at Gremlin.Net.Driver.Remote.DriverRemoteConnection.SubmitBytecodeAsync(Guid requestid, Bytecode bytecode)
         at Gremlin.Net.Driver.Remote.DriverRemoteConnection.SubmitAsync[S,E](Bytecode bytecode)
         at Gremlin.Net.Process.Remote.RemoteStrategy.ApplyAsync[S,E](ITraversal`2 traversal)
         at Gremlin.Net.Process.Traversal.DefaultTraversal`2.ApplyStrategiesAsync()
         at Gremlin.Net.Process.Traversal.DefaultTraversal`2.Promise[TReturn](Func`2 callback)
       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Florian Hockmann Florian Hockmann
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: