Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractRouter.getPeerTopics() may throw ConcurrentModificationException #362

Merged

Conversation

Nashatyrev
Copy link
Collaborator

Fix returning internal mutable set to avoid ConcurrentModificationException

Might result in the following exception:

java.util.concurrent.CompletionException: java.util.ConcurrentModificationException
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:687)
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662)
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2200)
at io.libp2p.pubsub.PubsubApiImpl.getPeerTopics(PubsubApiImpl.kt:114)
at io.libp2p.pubsub.gossip.Gossip.getPeerTopics(Gossip.kt)

@Nashatyrev Nashatyrev merged commit 9fd7741 into libp2p:develop May 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants