northwesternmutual / grammes

A Go package built to communicate with Apache TinkerPop™ Graph computing framework using Gremlin; a graph traversal language used by graph databases such as JanusGraph®, MS Cosmos DB, AWS Neptune, and DataStax® Enterprise Graph.
Apache License 2.0
125 stars 45 forks source link

Is there a limit on size of gremlin query, and is this configurable? #30

Open tucats opened 4 years ago

tucats commented 4 years ago

I have a query that is about 12k characters long. I am getting server errors of the "unexpected end of input" flavor, followed by a panic in the response unmarshall operation. Empirically, I can see that if I reduce the query length to 7362 characters (at least in my case, on my configuration) the query goes through without error. I'm guessing I'm running into a buffer length issue of 8k including socket overhead, but I don't really know.

Is there a limit on the length of the query? Or something I need to do to cause it to send multiple chunks (frames?) to represent the entire query? Note that I can execute this from the apache gremlin console without error, so I believe the query itself is well-formed.

The code looks approximately like this (the somewhat ugly template-generated query is omitted here).

client, err := grammes.DialWithWebSocket("ws://127.0.0.1:8182")
if err != nil {
    fmt.Printf("Error while creating client: %s\n", err.Error())
}
defer client.Close()
query := ` ... super long query goes here ...`

res, err := client.ExecuteStringQuery(query)

Perhaps I am just missing a configuration step?