You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/12/16 14:52:00 UTC

[jira] [Commented] (TINKERPOP-2837) Thread-safe problem when using Collections.synchronizedMap in ImmutableMetrics

    [ https://issues.apache.org/jira/browse/TINKERPOP-2837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17648666#comment-17648666 ] 

ASF GitHub Bot commented on TINKERPOP-2837:
-------------------------------------------

ministat opened a new pull request, #1908:
URL: https://github.com/apache/tinkerpop/pull/1908

   The current annotations object created by Collections.synchronizedMap() will be shared across multiple threads, and some methods which access this object do not apply lock (synchronized), as a result, NPE occurs. This patch fixed this issue.
   
   




> Thread-safe problem when using Collections.synchronizedMap in ImmutableMetrics
> ------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2837
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2837
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: language
>    Affects Versions: 3.5.4
>            Reporter: Redriver
>            Priority: Major
>
> When I run the profile() in SparkGraphComputer, I got NPE:
>  
> g.V().hasLabel('Account').has('Source', 10).has('AccountId', '1000017194').as('sourceAccount').match( __.as('sourceAccount').outE().inV().hasLabel('phone').as('node1'), __.as('sourceAccount').outE().inV().hasLabel('name').as('node2'), __.as('node1').inE().outV().hasLabel('Account').as('targetAccount'), __.as('targetAccount').outE().inV().as('node2'), where('targetAccount', neq('sourceAccount'))).select('targetAccount').valueMap().profile()
>  
> 22/12/07 02:21:00.980 dag-scheduler-event-loop ERROR DAGScheduler: Failed to update accumulator 17 (org.apache.spark.util.LegacyAccumulatorWrapper) for task 188
> java.lang.NullPointerException
>         at java.util.Collections$SynchronizedMap.entrySet(Collections.java:2613)
>         at org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics.aggregate(MutableMetrics.java:139)
>         at org.apache.tinkerpop.gremlin.process.traversal.step.util.ProfileStep$ProfileBiOperator.apply(ProfileStep.java:136)
>         at org.apache.tinkerpop.gremlin.process.traversal.step.util.ProfileStep$ProfileBiOperator.apply(ProfileStep.java:130)
>         at org.apache.tinkerpop.gremlin.spark.process.computer.MemoryAccumulator.addAccumulator(MemoryAccumulator.java:43)
>         at org.apache.tinkerpop.gremlin.spark.process.computer.MemoryAccumulator.addInPlace(MemoryAccumulator.java:48)
>         at org.apache.tinkerpop.gremlin.spark.process.computer.MemoryAccumulator.addInPlace(MemoryAccumulator.java:29)
>         at org.apache.spark.util.LegacyAccumulatorWrapper.merge(AccumulatorV2.scala:512)
>         at org.apache.spark.scheduler.DAGScheduler$$anonfun$updateAccumulators$1.apply(DAGScheduler.scala:1255)
>         at org.apache.spark.scheduler.DAGScheduler$$anonfun$updateAccumulators$1.apply(DAGScheduler.scala:1246)
>         at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
>         at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
>         at org.apache.spark.scheduler.DAGScheduler.updateAccumulators(DAGScheduler.scala:1246)
>         at org.apache.spark.scheduler.DAGScheduler.handleTaskCompletion(DAGScheduler.scala:1341)
>         at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:2105)
>         at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2057)
>         at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2046)
>         at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:49)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)