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

camel-spring - Using Spring XML can create multiple SpringCamelContext instances causing a deadlock when multiple camel proxies involved

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.7.5, 3.7.2
    • 3.7.6, 3.12.0
    • camel-spring
    • None
    • Unknown

    Description

      My scenario:

      1. Http client -> Transactional servlet consumer
      2. Servlet route calls java bean
      3. Java bean calls another route using Camel Proxy and direct-vm
      4. CamelInvocationHandler calls direct-vm route and then hangs as route is never executed, waiting for worker

      At this point it is all deadlocked and it never ends.
      From what I can see the problem happens in DefaultReactiveExecutor.Worker.

      From debugging I can see there are two DefaultReactiveExecutor.Workers at the point of deadlock.

      At point 3, Worker number 2 executes SimpleTask which waits for it to finish- this task is to execute bean as per step 3.
      Bean execution then attempts to trigger another route using Camel Proxy and direct-vm and schedules it on Worker number 2.
      However immediately after scheduling on Worker number 2 the direct-vm processor, Worker 1 executes executeFromQueue (triggered by countdownLatch waiting for direct-vm call to finish) which then causes deadlock because task added to Worker number 2 is never executed.

      I have confirmed above in debugging, will try to come up with simple test case as our scenario is rather complex and involves multiple projects.

      Unfortunately for us this is blocker as our solution which was working perfectly fine with camel 2 is not working.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nannou9 Piotr Klimczak
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: