Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 9117 invoked from network); 8 Feb 2007 18:41:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2007 18:41:03 -0000 Received: (qmail 34857 invoked by uid 500); 8 Feb 2007 18:41:09 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 34841 invoked by uid 500); 8 Feb 2007 18:41:09 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 34832 invoked by uid 99); 8 Feb 2007 18:41:09 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 10:41:09 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of james.strachan@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 10:41:00 -0800 Received: by ug-out-1314.google.com with SMTP id m3so536532ugc for ; Thu, 08 Feb 2007 10:40:39 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rLkv5CBLjaMyVe2PJr2ND0z6DYHJjf1YZtT0P6l3TE/KAL+N3eaEOM4ym4xRn364EEnspktYSy6egTSVOYJRJNIaNso76sacDAuHzU89XN+2ZAGg7tKeii//oXPhlPUH95Fpb3eOCzNoQDHD8KiSIhf0b85xJNY+UgeNPYv8SKs= Received: by 10.78.178.5 with SMTP id a5mr4355104huf.1170960039122; Thu, 08 Feb 2007 10:40:39 -0800 (PST) Received: by 10.78.155.6 with HTTP; Thu, 8 Feb 2007 10:40:39 -0800 (PST) Message-ID: Date: Thu, 8 Feb 2007 18:40:39 +0000 From: "James Strachan" To: users@activemq.apache.org Subject: Re: Async Exception, multiple threads, one connection In-Reply-To: <8870982.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8868199.post@talk.nabble.com> <8870982.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org So yes - its looking like the connection is being disconnected due to inactivity. You could increase the inactivity timeout to something much bigger (or even disable it) to avoid the broker closing your connections. Whether the connection is closed or not, with failover: all sessions/producers/consumers/destinations are recreated for you On 2/8/07, Paul French wrote: > > > Okay, I switched on garbage collection output using the flag -verbosegc and > the Aysnc failure on the client does coincide with a FULL GC event. On my > client system I am close to the max heap size nearly all the time. The FULL > GC takes about 25 seconds to complete. All client threads are suspended > during this time. I assume then that the broker is not recieving heartbeat > messages of some sort from the client program and so closes the connection. > Again it appears from the broker log this is the case. Hence when the client > starts again the connection has been lost. Hence the ultimate solution is to > stop the FULL GC happening in the first place!! > > However if I set the connection url to use failover can someone explain to > me what happens if i have created 20 sessions (where each session has a one > consumer and one producer) against this connection and then the connection > fails but is reconnected? > > Does my client program need to trap any Exceptions to continue or will all > the sessions, consumers and producers still be usable even after the > connection has been re-established? > > What happens to any temporary queues I have created. Temporary queues are > unique per connection. Hence when a connection is re-established will > ActiveMQ maintain my current temporary queues? > > > > > Paul French wrote: > > > > For me this is a continuation of..... > > > > http://www.nabble.com/Async-Exception%3A-Broken-Pipe-t3160498s2354.html#a8765808 > > > > ...but I have now taking the advice from the above post and have refined > > the problem I am having. > > > > > > Environment > > I am now using the latest 4.2 snapshot as requested (29th Jan 2007) > > I am also running the broker on its own dedicated machine. > > I am also using Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed > > mode) on all machines. > > > > Configuration > > ActiveMQ broker is configured with no persistence and no transactions are > > used. Async messaging is used. > > > > Problem > > I have a program that simply starts as many threads (non-daemon) as you > > require (I use 20). Once all threads have been started the main thread > > simply finishes. Each thread does the following: > > > > Gets a connection > > > > connection = singleConnectionFactory.createConnection(); > > > > where the following spring context snippet is used > > > > > class="org.springframework.jms.connection.SingleConnectionFactory" > > destroy-method="destroy"> > > > > > > > value="tcp://192.168.160.86:61616?jms.prefetchPolicy.queuePrefetch=1" /> > > TRUE > > > > > > > > > > Please note that each thread is given the same connection since I am using > > a SingleConnectionFactory. Each thread then runs in a continuous loop > > doing nothing of interest. I do not create any sessions, producers or > > consumers and I do not send any messages. I do not touch the connection > > whatsoever!!! > > > > then after five minutes or so my program reports the Exception.......... > > > > WARN [08/02/2007 11:47:01]: Async exception with no exception listener: > > java.net.SocketException: Broken pipe > > java.net.SocketException: Broken pipe > > at java.net.SocketOutputStream.socketWrite0(Native Method) > > at > > java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) > > at java.net.SocketOutputStream.write(SocketOutputStream.java:136) > > at > > org.apache.activemq.transport.tcp.TcpBufferedOutputStream.flush(TcpBufferedOutputStream.java:109) > > at java.io.DataOutputStream.flush(DataOutputStream.java:106) > > at > > org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:119) > > at > > org.apache.activemq.transport.InactivityMonitor.writeCheck(InactivityMonitor.java:81) > > at > > org.apache.activemq.transport.InactivityMonitor.access$100(InactivityMonitor.java:35) > > at > > org.apache.activemq.transport.InactivityMonitor$2.run(InactivityMonitor.java:57) > > at > > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) > > at > > java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280) > > at > > java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135) > > at > > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65) > > at > > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142) > > at > > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166) > > at > > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) > > at > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) > > at java.lang.Thread.run(Thread.java:595) > > > > The wierd thing is I know my program is about to report this Exception > > since all threads in my program stop doing any activity for about 25 > > seconds. During this 25 seconds the above Exception is thrown. Then all my > > threads carry on as normal. > > > > I do not understand why having a single connection open should cause such > > problems and stop all my threads. Any ideas? I know this problem does not > > seem to relate to a real life situation but I have factored it out as a > > problem from a real situation and tried to simplify the example. > > > > > > > > > > > > > > -- > View this message in context: http://www.nabble.com/Async-Exception%2C-multiple-threads%2C-one-connection-tf3194160s2354.html#a8870982 > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- James ------- http://radio.weblogs.com/0112098/