[ 
https://issues.apache.org/jira/browse/TINKERPOP-2554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stephen Mallette closed TINKERPOP-2554.
---------------------------------------
    Fix Version/s: 3.6.0
                   3.5.1
                   3.4.12
         Assignee: Stephen Mallette
       Resolution: Fixed

CTR fixed this in 3.4.12/3.5.1 with:

https://github.com/apache/tinkerpop/commit/445ab1030585fb05a19e9fce8d601f7876529cb7

and 3.6.0 with the additional:

https://github.com/apache/tinkerpop/commit/b497c8278f6ac7e756e5462eab06cf4cdf2d0e79

> Extracting step metrics from ProfileStep throws NPE if the step was not 
> triggered
> ---------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2554
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2554
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.4.10
>            Reporter: Saikiran Boga
>            Assignee: Stephen Mallette
>            Priority: Minor
>             Fix For: 3.4.12, 3.5.1, 3.6.0
>
>
> When extracting step metrics from ProfileStep, this code block below[1] 
> assumes that step metrics is always initialized. But if a step does not 
> invoke starts hasNext() or next() methods for any particular reason, this 
> throws an NPE.
> An example case where this could happen is if a step decides not to invoke 
> any upstream step by halting the execution:
> {noformat}
> step1 -> ProfileStep -> step2 -> ProfileStep -> step3 -> ProfileStep -> step4 
> -> ProfileStep{noformat}
> In this case if say step3/4 decides not to get starts from previous step, 
> then the step metrics on all the preceding ProfileStep are left uninitialized.
> Sample trace:
> {noformat}
> java.lang.NullPointerException: null
> at 
> org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalMetrics.addTopLevelMetrics(DefaultTraversalMetrics.java:157)
> at 
> org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalMetrics.setMetrics(DefaultTraversalMetrics.java:143)
> at 
> org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.ProfileSideEffectStep.hasNext(ProfileSideEffectStep.java:75)
>  
> at 
> org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.hasNext(ExpandableStepIterator.java:42)
> ...{noformat}
> [1] 
> [https://github.com/apache/tinkerpop/blob/master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java#L157]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to