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

Optimize task cancellation within BeanExpirationScheduler and SessionExpirationScheduler

    • Icon: Enhancement Enhancement
    • Resolution: Won't Do
    • Icon: Major Major
    • 8.0.0.CR1
    • 8.0.0.Beta1
    • Clustering
    • None

      These implementation uses a ScheduledThreadPoolExecutor to schedule expiration of beans/sessions, and rely heavily on task cancellation to reschedule expiration upon access.
      Unfortunately, the remove method of the BlockingQueue used by ScheduledThreadPoolExecutor is an O(N) operation.

            [WFLY-2534] Optimize task cancellation within BeanExpirationScheduler and SessionExpirationScheduler

            Upon further review, task queue removal isn't actually an O(N) operation. The task references an index into the queue, which gets updated as its position shifts, so queue removal is really O(1).

            Paul Ferraro added a comment - Upon further review, task queue removal isn't actually an O(N) operation. The task references an index into the queue, which gets updated as its position shifts, so queue removal is really O(1).

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

                Created:
                Updated:
                Resolved: