Hello,

I have a Blueprint bundle that stays in state "Stopping".

There's a Camel route defined in a Blueprint (find an example below). The
blueprint is deployed to the deploy folder. When I try to stop the Blueprint
(e.g. by deleting the file) while there are inflight exchanges on the Camel
route, Camel's shutdown strategy waits for the exchanges to get processed.
When this does not happen until a defined timeout, route shutdown is
enforced. Log example:

2016-06-17 13:25:59,753 | WARN  | raf-4.0.4/deploy | DefaultShutdownStrategy    
     
| 55 - org.apache.camel.camel-core - 2.18.0.SNAPSHOT | Timeout occurred
during graceful shutdown. Forcing the routes to be shutdown now. Notice:
some resources may still be running as graceful shutdown did not complete
successfully.
2016-06-17 13:25:59,754 | WARN  | 1 - ShutdownTask | DefaultShutdownStrategy    
     
| 55 - org.apache.camel.camel-core - 2.18.0.SNAPSHOT | Interrupted while
waiting during graceful shutdown, will force shutdown now.
2016-06-17 13:25:59,754 | INFO  | raf-4.0.4/deploy | DefaultShutdownStrategy    
     
| 55 - org.apache.camel.camel-core - 2.18.0.SNAPSHOT | There are 5 inflight
exchanges:


>From Camel's point of view the route is shut down at the end:
2016-06-17 13:25:59,755 | INFO  | raf-4.0.4/deploy | DefaultShutdownStrategy    
     
| 55 - org.apache.camel.camel-core - 2.18.0.SNAPSHOT | Graceful shutdown of
1 routes completed in 20 seconds


karaf@root()> camel:context-list 
karaf@root()> camel:route-list 
karaf@root()>


Problem is: the bundle stays in state "Stopping":

karaf@root()> bundle:list|grep bp
START LEVEL 100 , List Threshold: 50
ID | State    | Lvl | Version         | Name
66 | Stopping |  80 | 0.0.0           | bp.xml


I found similar threads like this one, but no solution:
http://karaf.922171.n3.nabble.com/Forcing-a-camel-route-to-stop-td4039870.html#a4039876

It's clear, that OSGi knows no "bundle:kill".

Seems to me that there is no timeout that forces a bundle to get killed
either. I cannot shutdown Karaf anymore in this state, only option is to
kill the Java process. A `bundle:stop 66` doesn't work here, too, hangs
forever.

My questions on this topic are:

a) Why is the bundle "stopping", even when Camel seems to have shutdown in
the end?

b) Is this a bug or broken by design and can I circumvent it (e.g. by
changing the shutdown strategy)?


Best regards!
mdo




<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
           xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
          xsi:schemaLocation="
                http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
                http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd";>

  <bean id="shutdown"
        class="org.apache.camel.impl.DefaultShutdownStrategy">
        <property name="timeout" value="20"></property>
  </bean>

    <camelContext id="testctx"
xmlns="http://camel.apache.org/schema/blueprint";>
        <route id="testroute">
            <from
uri="quartz2://myGroup/myTimerName?cron=0/10+*+*+?+*+MON-FRI" />
                
                <pollEnrich>
                        
<constant>file:///tmp/poll/?fileName=file&amp;noop=true</constant>
                </pollEnrich>
                <log message="polled: ${body}" />
        </route>
    </camelContext>

</blueprint>







--
View this message in context: 
http://karaf.922171.n3.nabble.com/Stalling-Karaf-with-inflight-exchanges-on-a-Blueprint-Camel-route-tp4046883.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to