Concurrent, unsynchronized mutation of a shared BlueMap marker map
src/main/java/com/tpwalke2/bluemapsignmarkers/core/bluemap/BlueMapAPIConnector.java — addMarker (132-154),
updateMarker (114-125), removeMarker (127-130) vs. getMarkerSets (175-207, synchronized)
getMarkerSets(...) is synchronized, but addMarker/updateMarker/removeMarker — which mutate the
Map<String, Marker> returned by MarkerSet.getMarkers() — are static and not synchronized on anything.
ReactiveQueue's executor is sized to availableProcessors(), so on any multi-core host more than one
MarkerAction can be dispatched to processMarkerAction concurrently. Two actions targeting different sign
positions on the same map + marker group resolve to the same cached MarkerSet and thus the same underlying marker
Map instance (whose concrete thread-safety is controlled by BlueMap's API, not this mod). Concurrent
put/remove/iteration on that map risks lost updates or corruption during a resize. getMarkerSets's
synchronized only protects lookup/creation of the list reference, not what happens to its contents afterward.
Concurrent, unsynchronized mutation of a shared BlueMap marker map
src/main/java/com/tpwalke2/bluemapsignmarkers/core/bluemap/BlueMapAPIConnector.java—addMarker(132-154),updateMarker(114-125),removeMarker(127-130) vs.getMarkerSets(175-207,synchronized)getMarkerSets(...)issynchronized, butaddMarker/updateMarker/removeMarker— which mutate theMap<String, Marker>returned byMarkerSet.getMarkers()— arestaticand not synchronized on anything.ReactiveQueue's executor is sized toavailableProcessors(), so on any multi-core host more than oneMarkerActioncan be dispatched toprocessMarkerActionconcurrently. Two actions targeting different signpositions on the same map + marker group resolve to the same cached
MarkerSetand thus the same underlying markerMapinstance (whose concrete thread-safety is controlled by BlueMap's API, not this mod). Concurrentput/remove/iteration on that map risks lost updates or corruption during a resize.getMarkerSets'ssynchronizedonly protects lookup/creation of the list reference, not what happens to its contents afterward.