Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-5994

CamelJob implementation rely on some inconsistent endpoints LRU cache - Camel endpoints may not be called on quartz fire after some days of uptime

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.9.5, 2.10.3
    • 2.9.6, 2.10.4, 2.11.0
    • camel-quartz
    • None
    • Quartz is in deployed in cluster mode.

    • Advanced

    Description

      CamelJobs rely on some endpoints LRU cache from camel context. If i'm not wrong, since LRU Cache relies on SoftReferences, Garbage Collector can decide to evict some entries and especially QuartzEndpoints.

      It happens that sometimes endpoints evicted from LRU Caches are QuartzEndpoints. Since QuartzEnpoints are searched from CamelJob in LRU cache, they are not reachable anymore.

      The side effect, is that CamelJob isntance initializes a new QuartzEndpoint, but loadbalancer is not initialized since it is initialized from QuartzConsumer.

      The result is that quartz triggers jobs that instanciate Quartz endpoints with unintialized load balancers which are unable to call processor from the routes associated.

      I have joined a fix that rely on the search of QuartzEndpoints from initalized routes of Camel context.

      Fundamentally, the search of endpoints should not rely on endpoints LRU cache. It is a broken design.

      Hope it helps.

      By the way, there are other issues related to QuartzEndpoint load balancer initalization: If quartz starts before startup of Camel routes you will have the same issue: Correctly initialized QuartzEndpoints are not in LRU cache since Camel has not started routes (and so endpoints and consumers). Quartz will trigger job, and camel job will search for QuartzEndpoint and put it in LRUCache with uninitialized load balancer.

      Attachments

        1. QuartzCronRouteWithSmallCacheTest.java
          3 kB
          Denis Delangle
        2. CamelJob.java
          3 kB
          Alexis Kinsella

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              alexiskinsella Alexis Kinsella
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: