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

A RejectedExecutionException is thrown after the shutdown of a context

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.11.1
    • 2.12.0
    • camel-core
    • None
    • Unknown

    Description

      When you shutdown a route, it's not completely stopped even after it says so.

      If you lanch the following route definition in a context that has a 1 second timeout for shutdown

      from("timer:single?repeatCount=1")                                           //
              .setBody(constant("This should never be displayed in the console"))  //
              .delay(FIFTEEN_SECONDS)                                              //
              .to("stream:out");                                                   //
      

      Here's what' you have in the console

      30 août 2013 11:51:17 org.apache.camel.impl.DefaultCamelContext start
      INFO: Apache Camel 2.11.1 (CamelContext: camel-1) is starting
      30 août 2013 11:51:17 org.apache.camel.management.ManagementStrategyFactory create
      INFO: JMX enabled.
      30 août 2013 11:51:18 org.apache.camel.impl.converter.DefaultTypeConverter doStart
      INFO: Loaded 172 type converters
      30 août 2013 11:51:18 org.apache.camel.impl.DefaultCamelContext doStartOrResumeRouteConsumers
      INFO: Route: route1 started and consuming from: Endpoint[timer://single?repeatCount=1]
      30 août 2013 11:51:18 org.apache.camel.management.DefaultManagementLifecycleStrategy$TimerListenerManagerStartupListener onCamelContextStarted
      INFO: Load performance statistics enabled.
      30 août 2013 11:51:18 org.apache.camel.impl.DefaultCamelContext start
      INFO: Total 1 routes, of which 1 is started.
      30 août 2013 11:51:18 org.apache.camel.impl.DefaultCamelContext start
      INFO: Apache Camel 2.11.1 (CamelContext: camel-1) started in 0.340 seconds
      30 août 2013 11:51:20 org.apache.camel.impl.DefaultCamelContext doStop
      INFO: Apache Camel 2.11.1 (CamelContext: camel-1) is shutting down
      30 août 2013 11:51:20 org.apache.camel.impl.DefaultShutdownStrategy doShutdown
      INFO: Starting to graceful shutdown 1 routes (timeout 1 seconds)
      30 août 2013 11:51:20 org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run
      INFO: Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 1 seconds.
      30 août 2013 11:51:21 org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run
      INFO: Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 0 seconds.
      30 août 2013 11:51:21 org.apache.camel.impl.DefaultShutdownStrategy doShutdown
      ATTENTION: Timeout occurred. Now forcing the routes to be shutdown now.
      30 août 2013 11:51:21 org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run
      ATTENTION: Interrupted while waiting during graceful shutdown, will force shutdown now.
      30 août 2013 11:51:21 org.apache.camel.impl.DefaultShutdownStrategy doShutdown
      INFO: Graceful shutdown of 1 routes completed in 1 seconds
      30 août 2013 11:51:21 org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run
      INFO: Route: route1 shutdown complete, was consuming from: Endpoint[timer://single?repeatCount=1]
      30 août 2013 11:51:21 org.apache.camel.impl.DefaultInflightRepository doStop
      ATTENTION: Shutting down while there are still 1 in flight exchanges.
      30 août 2013 11:51:21 org.apache.camel.impl.DefaultCamelContext doStop
      INFO: Apache Camel 2.11.1 (CamelContext: camel-1) uptime 3.356 seconds
      30 août 2013 11:51:21 org.apache.camel.impl.DefaultCamelContext doStop
      INFO: Apache Camel 2.11.1 (CamelContext: camel-1) is shutdown in 1.015 seconds
      30 août 2013 11:51:34 org.apache.camel.impl.converter.DefaultTypeConverter doStart
      INFO: Loaded 172 type converters
      30 août 2013 11:51:34 org.apache.camel.util.CamelLogger log
      ATTENTION: Error processing exchange. Exchange[Message: This should never be displayed in the console]. Caused by: [java.util.concurrent.RejectedExecutionException - null]
      java.util.concurrent.RejectedExecutionException
      	at org.apache.camel.processor.interceptor.DefaultChannel.continueProcessing(DefaultChannel.java:356)
      	at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:327)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      	at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      	at org.apache.camel.processor.DelayProcessorSupport.process(DelayProcessorSupport.java:117)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      	at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      	at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      	at org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      	at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      	at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:391)
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
      	at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      	at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
      	at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      	at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
      	at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
      	at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      	at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
      	at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:135)
      	at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:63)
      	at java.util.TimerThread.mainLoop(Timer.java:512)
      	at java.util.TimerThread.run(Timer.java:462)
      

      First you can see that it starts the TypeConverter after the shutdown of the context. Then you have a big exception.

      Attachments

        1. Stop.java
          1 kB
          Antoine DESSAIGNE

        Activity

          People

            davsclaus Claus Ibsen
            antoine.dessaigne Antoine DESSAIGNE
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: