pietermartin / sqlg

TinkerPop graph over sql
MIT License
246 stars 51 forks source link

ConcurrentModificationException on concurrent schema creations #477

Closed pietermartin closed 1 year ago

pietermartin commented 1 year ago
ERROR [] [boundedElastic-26] c.r.c.n.l.NetworkElementLoadGuru Failed to create schema elements 'xml_LNRELG for NSN_LTE', swallowing exception.
java.util.ConcurrentModificationException: null
    at java.util.HashMap$HashIterator.nextNode(HashMap.java:1597) ~[?:?]
    at java.util.HashMap$KeyIterator.next(HashMap.java:1620) ~[?:?]
    at java.util.AbstractCollection.addAll(AbstractCollection.java:335) ~[?:?]
    at java.util.HashSet.<init>(HashSet.java:121) ~[?:?]
    at org.umlg.sqlg.structure.topology.Topology.getTableLabels(Topology.java:1929) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.structure.topology.Topology.getTableLabels(Topology.java:1960) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.sql.parse.ReplacedStep.appendPathForVertexStep(ReplacedStep.java:172) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.sql.parse.ReplacedStep.appendPath(ReplacedStep.java:145) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.sql.parse.ReplacedStep.calculatePathForStep(ReplacedStep.java:408) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.sql.parse.ReplacedStepTree.walkReplacedSteps(ReplacedStepTree.java:88) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.sql.parse.GremlinParser.parse(GremlinParser.java:30) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.step.SqlgGraphStep.parseForStrategy(SqlgGraphStep.java:268) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.step.SqlgGraphStep.prepare(SqlgGraphStep.java:207) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.step.SqlgGraphStep.elements(SqlgGraphStep.java:201) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.step.SqlgGraphStep.processNextStart(SqlgGraphStep.java:100) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:135) ~[gremlin-core-3.6.2-20230117.222816-4.jar:3.6.2-SNAPSHOT]
    at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:40) ~[gremlin-core-3.6.2-20230117.222816-4.jar:3.6.2-SNAPSHOT]
    at org.apache.tinkerpop.gremlin.process.traversal.Traversal.fill(Traversal.java:184) ~[gremlin-core-3.6.2-20230117.222816-4.jar:3.6.2-SNAPSHOT]
    at org.apache.tinkerpop.gremlin.process.traversal.Traversal.toList(Traversal.java:122) ~[gremlin-core-3.6.2-20230117.222816-4.jar:3.6.2-SNAPSHOT]
    at org.umlg.sqlg.structure.topology.TopologyManager.addVertexLabelPartition(TopologyManager.java:313) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.structure.topology.Partition.createRangePartition(Partition.java:249) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.structure.topology.AbstractLabel.createRangePartition(AbstractLabel.java:328) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at org.umlg.sqlg.structure.topology.AbstractLabel.lambda$ensureRangePartitionExists$0(AbstractLabel.java:165) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at java.util.Optional.orElseGet(Optional.java:364) ~[?:?]
    at org.umlg.sqlg.structure.topology.AbstractLabel.ensureRangePartitionExists(AbstractLabel.java:165) ~[sqlg-core-3.0.0-20230105.071705-11.jar:3.0.0-SNAPSHOT]
    at com.rorotika.cm.network.audit.AuditManager.ensurePivotAuditTableExist(AuditManager.java:600) ~[classes/:?]
    at com.rorotika.cm.network.load.NetworkElementSchemaCreator.ensureVertexLabelExist(NetworkElementSchemaCreator.java:284) ~[classes/:?]
    at com.rorotika.cm.network.load.NetworkElementSchemaCreator.ensureVertexLabelsExists(NetworkElementSchemaCreator.java:115) ~[classes/:?]
    at com.rorotika.cm.network.load.NetworkElementLoadGuru.lambda$load$3(NetworkElementLoadGuru.java:137) ~[classes/:?]
    at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:185) ~[reactor-core-3.4.10.jar:3.4.10]
    at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.runAsync(FluxPublishOn.java:440) ~[reactor-core-3.4.10.jar:3.4.10]
    at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.run(FluxPublishOn.java:527) ~[reactor-core-3.4.10.jar:3.4.10]
    at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84) ~[reactor-core-3.4.10.jar:3.4.10]
    at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37) ~[reactor-core-3.4.10.jar:3.4.10]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
pietermartin commented 1 year ago

Look at using CopyOnWrite List or Set for topology collections.