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

Context cleanup not always executed in ManagedScheduledExecutorService

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Concurrency Utilities
    • None
    • ---
    • ---

      A task scheduled using ManagedScheduledExecutorService#scheduledAtFixedRate that takes longer than the specified interval of the task will trigger a race condition in org.glassfish.enterprise.concurrent.internal.ManagedScheduledThreadPoolExecutor.

      The context reset handles are saved in the task and should only be executed once per thread & task, but the task can be resubmitted to and dequeued from the task queue before the reset is executed. If that happens on a different thread, the reset handles are overwritten and on one of the threads the reset is never executed.

      We observed this behaviour on WildFly 30.1.Final in an application with JakartaRS and the ResteasyContext stack grows without bounds.

      This is a reproducer of the problem: https://github.com/inventage/wildfly-managed-scheduled-executor-service-reproducer
      We were able to reproduce this issue on WildFly 36 as well.

      ./gradlew war
      cp build/libs/WFLY-20677.war $JBOSS_HOME/standalone/deployments/

      https://github.com/eclipse-ee4j/glassfish-concurro

              emartins@redhat.com Eduardo Martins
              tangresh Dominik Menzi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: