-
Bug
-
Resolution: Done
-
Major
-
27.0.0.Beta1
-
None
This is a follow-up to WFLY-17165, which updated all of the passivation-related cache listeners to ensure that any subsequent Cache.evict(...) happen in a new thread.
Specifically, WFLY-17165 added generic non-blocking cache listeners that delegate to a blocking consumer. However, some of these use cases end up using a superfluous thread.
e.g.
FineSessionAttributesFactory create this listener:
this.evictAttributesListenerRegistration = new PrePassivateListener<>(this.namesCache, this::cascadeEvictAttributes).register(SessionAttributeNamesKey.class);
which uses this method:
private void cascadeEvictAttributes(SessionAttributeNamesKey key, Map<String, UUID> value) { String sessionId = key.getId(); for (UUID attributeId : value.values()) { this.executor.execute(() -> this.attributeCache.evict(new SessionAttributeKey(sessionId, attributeId))); } }
Since this method already delegates its Cache.evict(...) calls to separate threads, the cascadeEvictAttributes(...) itself does not need to delegate to a separate thread.