tinkergraph-gremlin-3.5.1: infinite recursion while logging traversal steps using traversal.getSteps()

42 views
Skip to first unread message

Umesh Gade

unread,
Dec 16, 2021, 7:24:05 AM12/16/21
to Gremlin-users
Hi,
    We recently upgraded from tinkergraph-gremlin-3.4.6 to tinkergraph-gremlin-3.5.1 as part of janusgraph-0.6.0 upgrade . After this upgrade, one of our log stament started throwing exception 
com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal["steps"]>java.util.Collections$UnmodifiableRandomAccessList[0]>org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep["traversal"]>org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal["steps"]>....

Output which is causing infinite recursion  is as below .
[
  {
    "labels": [
     
    ],
    "id": "0.0.0()",
    "traversal": {
      "graph": {
        "present": true
      },
      "steps": [
        {
          "labels": [
           
          ],
          "id": "0.0.0()",
          "traversal": {
            "graph": {
              "present": true
            },
            "steps": [
              {
                "labels": [
                 
                ],
                "id": "0.0.0()",
                "traversal": {
                  "graph": {
                    "present": true
                  },
                  "steps": [...

As a workaround, we fixed this by manually collecting steps by index upto traversal.getSteps().size()
for(int index=0; index <traversal.getSteps().size(); index++) {
    steps.add(traversal.getSteps().get(index));
}

Can anybody help understand what exactly changed after tinkergraph-gremlin-3.4.6 which is causing this and is there better workaround ?

Reply all
Reply to author
Forward
0 new messages