Skip to content

Conversation

@roro1506HD
Copy link
Contributor

The issue is from multiple places during that sendAsync process: Anything that loops through any CommandNode's children is subject to the CME.

The previous fix was only working for the root node, and wasn't even fully working given a few lines lower it's being added in an HashMap, which does .hashCode and loops through the root's children again.

This PR reverts the previous fix and fixes the concurrency issue once for all:

  • Changed the CommandNode's children map to a synchronized map, still backed by a LinkedHashMap
  • Lock everything in Commands#fillUsableCommands inside a synchronized block that uses the children map as lock object, the same lock object the synchronized map uses.

This has been tested with the test plugin published on this branch of my fork

Fixes #11101

@roro1506HD roro1506HD requested a review from a team as a code owner October 23, 2025 22:39
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Oct 23, 2025
@jpenilla jpenilla self-requested a review October 23, 2025 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

ConcurrentModificationException caused by async command sending patch

2 participants