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

Incorrect handling of large requests in Go GLV

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 3.6.7, 3.7.2
    • None
    • go
    • None

    Description

      When trying to send a request longer than about a megabyte, go GLV does not work correctly, possibly truncates data.

      Simple reproducer 

      func main() {
          driverRemoteConnection, err := gremlingo.NewDriverRemoteConnection("ws://localhost:8182/gremlin")
          if err != nil {
             fmt.Println(err)
             return
          }
          defer driverRemoteConnection.Close()
          g := gremlingo.Traversal_().WithRemote(driverRemoteConnection)
      
          const count = 1100
          var ids [count]string
          const idLength = 1000
      
          result := make([]byte, idLength)
          for i := 0; i < idLength; i++ {
             result[i] = 65
          }
          id := string(result)
      
          for i := 0; i < count; i++ {
             ids[i] = id
          }
      
          r, err := g.V(ids).Count().ToList()
          if err != nil {
             fmt.Println("err: ", err)
             return
          }
          fmt.Println("found: ", r[0].GetString()) 
      }

      with `count = 1000` it works as expected.

      Python GLV works as expected with same request.

      Error logged in Gremlin Server 

      io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(1048338) + length(1000) exceeds writerIndex(1048543): PooledUnsafeDirectByteBuf(ridx: 1048338, widx: 1048543, cap: 1048576)

      Attachments

        Activity

          People

            Unassigned Unassigned
            valentyn Valentyn Kahamlyk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: