Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-17203

Cascaded eviction handling uses more threads than necessary

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 27.0.0.Final
    • 27.0.0.Beta1
    • Clustering
    • 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.

              pferraro@redhat.com Paul Ferraro
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: