camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CAMEL-2573) Spring context deadlock if route stops
Date Wed, 24 Mar 2010 12:19:07 GMT

     [ https://issues.apache.org/activemq/browse/CAMEL-2573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen resolved CAMEL-2573.
--------------------------------

    Resolution: Incomplete

[13:14]  <cibsen> and you cannot just stop a JMS listener while its "running"
[13:14]  <tarjei> so I cannot stop a route using JMS then.
[13:15]  <cibsen> you can "suspend" it instead which could work while its running
[13:15]  <cibsen> http://camel.apache.org/route-throttling-example.html
[[13:15]  <cibsen> its not that easy since you are "sawing" the branch you are sitting
on
[13:15]  <cibsen> look at that example and use suspend instead of stop to see if that
works

> Spring context deadlock if route stops
> --------------------------------------
>
>                 Key: CAMEL-2573
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2573
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-jms, camel-spring-integration
>    Affects Versions: 2.2.0
>         Environment: Linux, Java 1.6 , ActiveMQ 5.3.1.
>            Reporter: Tarjei Huse
>         Attachments: deadlock.log
>
>
> I am a bit unsure if this is an Activemq or Camel bug. What happens is the following:
> I got a route:
> @Override
> 	public void configure() throws Exception {
> 		/* expects byte message of contentitem + header with index : ArrayList<Index>
list */
> 		from(incomming)
> 			.routeId(routeName)
> 			.onException(Exception.class)
> 				
> 				.log("Stopping route due to exception")
> 				.process(new RouteStoppingProccesor(routeName))
> 				//.to(incomming)
> 				.end()
> 			.unmarshal(new ActiveMqProtobufDataformat())
> 			.bean(new ContentItemTranslator(), "translate")
> 			.processRef("SolrPoster") // todo add aggregator here
> 				;
> 	}
> The RouteStoppingProccessor looks like this:
> public class RouteStoppingProccesor implements Processor {
> 	private static Logger log = Logger.getLogger("RouteStopper");
> 	
> 	private final String routeName;
> 	public RouteStoppingProccesor(String routeName) {
> 		this.routeName = routeName;
> 		
> 	}
> 	
> 	@Override
> 	public void process(Exchange exchange) throws Exception {
> 		log.error("\nXXXX: STOP ROUTE: " + routeName + "\n\n");
> 		exchange.getContext().stopRoute(this.routeName);
> 	}
> }
> When the RouteStoppingProcessor is called, the processor hangs:
> "DefaultMessageListenerContainer-1" prio=10 tid=0x09607400 nid=0x1bbe in Object.wait()
[0x6dbba000]
>    java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0xb1449530> (a java.lang.Object)
> 	at java.lang.Object.wait(Object.java:485)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer.doShutdown(DefaultMessageListenerContainer.java:489)
> 	- locked <0xb1449530> (a java.lang.Object)
> 	at org.springframework.jms.listener.AbstractJmsListeningContainer.shutdown(AbstractJmsListeningContainer.java:211)
> 	at org.springframework.jms.listener.AbstractJmsListeningContainer.destroy(AbstractJmsListeningContainer.java:149)
> 	at org.apache.camel.component.jms.JmsConsumer.doStop(JmsConsumer.java:64)
> 	at org.apache.camel.impl.ServiceSupport.stop(ServiceSupport.java:81)
> 	at org.apache.camel.impl.ServiceSupport.stop(ServiceSupport.java:100)
> 	at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:93)
> 	at org.apache.camel.impl.RouteService.stopChildService(RouteService.java:212)
> 	at org.apache.camel.impl.RouteService.doStop(RouteService.java:180)
> 	at org.apache.camel.impl.ServiceSupport.stop(ServiceSupport.java:81)
> 	at org.apache.camel.impl.ServiceSupport.stop(ServiceSupport.java:100)
> 	at org.apache.camel.impl.DefaultCamelContext.stopRoute(DefaultCamelContext.java:632)
> 	- locked <0xb1449570> (a org.apache.camel.spring.SpringCamelContext)
> 	at com.scanmine.router.RouteStoppingProccesor.process(RouteStoppingProccesor.java:26)
> 	at org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53)
> 	at org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:82)
> 	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:93)
> 	at org.apache.camel.processor.RedeliveryErrorHandler.processExchange(RedeliveryErrorHandler.java:177)
> 	at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:143)
> 	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:88)
> 	at org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49)
> 	at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:228)
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:74)
> 	at org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:333)
> 	at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:110)
> 	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:88)
> 	at org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49)
> 	at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:228)
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:74)
> 	at org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:66)
> 	at org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
> 	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
> 	at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:83)
> 	at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543)
> 	at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482)
> 	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
> 	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
> 	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
> 	at java.lang.Thread.run(Thread.java:619)
> This also causes the whole CamelContext to lock up. The complete output of kill - 3 +
a bit of the log is attached. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message