PersistentEntitiesResourceMappings uses a ConcurrentReferenceHashMap as a cache for mapped ResourceMetadata. Such map uses Soft references and therefore the can be garbage collected when under limited memory. Even if getMetadataFor() uses a lazy repopulation style, which is fine for such caches, the iterator() method, used by exportsTopLevelResourceFor() uses a copy of the cache, as it is, to select the candidates, but they might be gone because of garbage collection and the method doesn't try (and cannot) rebuild the information.
The cache field should just be a ConcurrentHashMap to avoid losing mapping at runtime, which they might initially work and then suddenly stop working, without any trace or exception
Affects: 3.2.6 (Moore SR6)
DATAREST-1502 Use ConcurrentHashMap in PersistentEntitiesResourceMappings instead of ConcurrentReferenceHashMap
The text was updated successfully, but these errors were encountered: