Spark link
No response
Plugin Version
1.5.0
Server Version
Paper 26.1.2-52
Server Platform
Paper
Describe the bug
Bug Report
Description
The mob markers layer fails repeatedly with a ConcurrentModificationException.
This happens because MobsLayer.getMarkers() iterates over a HashMap while the
server thread is simultaneously modifying it. The error is non-fatal but the mob
layer on the web map fails to update every time it occurs.
Environment
- Pl3xMapExtras version: 1.5.0
- Pl3xMap version: 26.1.2-545
- Server software: Paper 26.1.2-52
Error Log
[Pl3xMap-Markers/INFO]: [Pl3xMap] [ERROR] Failed to process layer pl3xmap_mobs for world world
[Pl3xMap-Markers/WARN]: java.util.ConcurrentModificationException
at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1606)
at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1629)
at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:337)
at Pl3xMapExtras-1.5.0.jar//com.ryderbelserion.map.marker.mobs.MobsLayer.lambda$getMarkers$0(MobsLayer.java:47)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at Pl3xMapExtras-1.5.0.jar//com.ryderbelserion.map.marker.mobs.MobsLayer.getMarkers(MobsLayer.java:47)
at Pl3xMap-26.1.2-545.jar//net.pl3x.map.core.renderer.task.UpdateMarkerData.lambda$parse$0(UpdateMarkerData.java:56)
at java.base/java.util.concurrent.ConcurrentHashMap$EntrySetView.forEach(ConcurrentHashMap.java:4892)
Root Cause
MobsLayer.java line 47 calls addAll() on what appears to be a plain HashMap,
which is not thread-safe. The Pl3xMap marker update task runs on a separate thread
via CompletableFuture/ForkJoinPool, so it races with the server thread that
modifies the mob collection.
Suggested Fix
Replace the underlying map/collection used in MobsLayer with a thread-safe
alternative such as ConcurrentHashMap, or wrap the iteration in a synchronized
block to prevent concurrent access.
Impact
- The mob marker layer silently fails to update on every occurrence
- The error repeats on a regular interval throughout the server's uptime
- No server crash or player-facing impact, but the web map mob layer is effectively broken
Steps to reproduce
Steps to Reproduce
No specific action required. Occurs automatically on a recurring basis during
normal server operation, particularly when there is mob activity in the world.
Additional context
No response
Agreements
Spark link
No response
Plugin Version
1.5.0
Server Version
Paper 26.1.2-52
Server Platform
Paper
Describe the bug
Bug Report
Description
The mob markers layer fails repeatedly with a
ConcurrentModificationException.This happens because
MobsLayer.getMarkers()iterates over aHashMapwhile theserver thread is simultaneously modifying it. The error is non-fatal but the mob
layer on the web map fails to update every time it occurs.
Environment
Error Log
[Pl3xMap-Markers/INFO]: [Pl3xMap] [ERROR] Failed to process layer pl3xmap_mobs for world world
[Pl3xMap-Markers/WARN]: java.util.ConcurrentModificationException
at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1606)
at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1629)
at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:337)
at Pl3xMapExtras-1.5.0.jar//com.ryderbelserion.map.marker.mobs.MobsLayer.lambda$getMarkers$0(MobsLayer.java:47)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at Pl3xMapExtras-1.5.0.jar//com.ryderbelserion.map.marker.mobs.MobsLayer.getMarkers(MobsLayer.java:47)
at Pl3xMap-26.1.2-545.jar//net.pl3x.map.core.renderer.task.UpdateMarkerData.lambda$parse$0(UpdateMarkerData.java:56)
at java.base/java.util.concurrent.ConcurrentHashMap$EntrySetView.forEach(ConcurrentHashMap.java:4892)
Root Cause
MobsLayer.javaline 47 callsaddAll()on what appears to be a plainHashMap,which is not thread-safe. The Pl3xMap marker update task runs on a separate thread
via
CompletableFuture/ForkJoinPool, so it races with the server thread thatmodifies the mob collection.
Suggested Fix
Replace the underlying map/collection used in
MobsLayerwith a thread-safealternative such as
ConcurrentHashMap, or wrap the iteration in asynchronizedblock to prevent concurrent access.
Impact
Steps to reproduce
Steps to Reproduce
No specific action required. Occurs automatically on a recurring basis during
normal server operation, particularly when there is mob activity in the world.
Additional context
No response
Agreements