You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by schmod54 <ab...@gmail.com> on 2007/06/12 11:34:55 UTC

failover infinite loop on client shutdown while message is being processed

If I try to shutdown my client while a message is being processed, sometimes
my FailoverTransport goes into an infinite loop:

11:48:10,446 DEBUG [FailoverTransport] Attempting connect to:
tcp://localhost:21616
11:48:10,446 DEBUG [WireFormatNegotiator] Sending: WireFormatInfo {
version=2, properties={TightEncodingEnabled=true, Ca
cheSize=1024, TcpNoDelayEnabled=true, SizePrefixDisabled=false,
StackTraceEnabled=true, MaxInactivityDuration=30000, Cac
heEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
11:48:10,446 DEBUG [WireFormatNegotiator] Received WireFormat:
WireFormatInfo { version=2, properties={TightEncodingEnab
led=true, CacheSize=1024, TcpNoDelayEnabled=true, SizePrefixDisabled=false,
StackTraceEnabled=true, MaxInactivityDuratio
n=30000, CacheEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
11:48:10,446 DEBUG [WireFormatNegotiator] tcp://localhost/127.0.0.1:21616
before negotiation: OpenWireFormat{version=2,
cacheEnabled=false, stackTraceEnabled=false, tightEncodingEnabled=false,
sizePrefixDisabled=false}
11:48:10,461 DEBUG [WireFormatNegotiator] tcp://localhost/127.0.0.1:21616
after negotiation: OpenWireFormat{version=2, c
acheEnabled=true, stackTraceEnabled=true, tightEncodingEnabled=true,
sizePrefixDisabled=false}
11:48:10,461 DEBUG [FailoverTransport] Connection established
11:48:10,461 DEBUG [FailoverTransport] Send oneway attempt: 112 failed.
11:48:10,461 INFO  [FailoverTransport] Transport failed, attempting to
automatically reconnect due to: java.io.IOExcepti
on
java.io.IOException
        at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:37)
        at
org.apache.activemq.state.ConnectionStateTracker.track(ConnectionStateTracker.java:94)
        at
org.apache.activemq.transport.failover.FailoverTransport.oneway(FailoverTransport.java:383)
        at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:43)
        at
org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:69)
        at
org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:74)
        at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1171)
        at
org.apache.activemq.ActiveMQSession.syncSendPacket(ActiveMQSession.java:1660)
        at
org.apache.activemq.ActiveMQMessageConsumer.close(ActiveMQMessageConsumer.java:541)
        at
org.springframework.jms.support.JmsUtils.closeMessageConsumer(JmsUtils.java:144)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(D
efaultMessageListenerContainer.java:899)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessa
geListenerContainer.java:865)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
        at
org.apache.activemq.state.ConnectionStateTracker.processRemoveConsumer(ConnectionStateTracker.java:228)
        at org.apache.activemq.command.RemoveInfo.visit(RemoveInfo.java:64)
        at
org.apache.activemq.state.ConnectionStateTracker.track(ConnectionStateTracker.java:90)
        ... 11 more


I'm using a Spring 2.0.4 DefaultMessageListenerContainer, which in turn uses
an ActiveMQ 4.1.1 PooledConnectionFactory which connects to:
failover:(tcp://localhost:11616,tcp://localhost:21616)initialReconnectDelay=100&maxReconnectAttempts=5
This happens intermittently when I Ctrl-C my client while it's processing a
message.  My message processing time is roughly 10 to 20 seconds.

I found this post:
http://www.nabble.com/RE%3A-failover-mode-and-client-shutdown-p8161222s2354.html
Which talks about a patch to get "clean shutdowns on the client when
failover is 
true and the client is presently disconnected."  However my client is
connected... can I do something to avoid this loop?  Thanks!
-- 
View this message in context: http://www.nabble.com/failover-infinite-loop-on-client-shutdown-while-message-is-being-processed-tf3906568s2354.html#a11075787
Sent from the ActiveMQ - User mailing list archive at Nabble.com.