JanusGraph / JanusGraph/janusgraph

It could be ConcurrentModificationException...

Open
#1,017 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

```
//SimpleBufferAddedRelations
private void cleanup() {
if(this.deleted != null && !this.deleted.isEmpty()) {
Set deletedSet = new HashSet(this.deleted);
this.deleted = null;
List newadded = new ArrayList(this.added.size() - deletedSet.size() / 2);
Iterator var3 = this.added.iterator();

while(var3.hasNext()) {// I think there will be exceptions.
InternalRelation r = (InternalRelation)var3.next();
if(!deletedSet.contains(r)) {
newadded.add(r);
}
}

this.added = newadded;
}
}
```
I used the parallelStream operation data. SimpleBufferAddedRelations will throw ConcurrentModificationException.I think it should be used CopyOnWriteArrayList

Contributor guide

Open the contributing guide

Research direction

Locate SimpleBufferAddedRelations and inspect cleanup(), then reproduce the reported ConcurrentModificationException through parallelStream use. Determine the concurrency behavior around deleted and added, and add a regression test that demonstrates the failure and verifies the completed fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.