thank you all firstly
we removed the mutex in the onTransportException. and it does not hang up
for more than 24 hours and it is still working well now.  we wonder whether
there will be  anything else wrong after we remove the mutex.
thanks 
eric

tabish121 wrote:
> 
> I wouldn't recommend that.  Instead just remove the mutex lock in the
> Connectors onTransportException as its not required.  Currently I'm
> thinking that we should probably just un-register for transport
> exceptions before we close down the transport since we don't really care
> at that point it an error occurs.
> 
> Regards
> Tim.
> 
>> -----Original Message-----
>> From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, August 19, 2008 11:14 AM
>> To: dev@activemq.apache.org
>> Subject: Re: activeMq hangs after long time using
>> 
>> I'd have to look at it a bit more, but my guess is that I would take
> the
>> thread->join out of the sync block
>> 
>> Filip
>> 
>> [EMAIL PROTECTED] wrote:
>> > hi, Filip
>> > i read the introduce of this bug in the url you give me . And find
> the
>> code
>> > modified in that page is the same with the code in the ActiveMQ cpp
> 2.2
>> > which i used in my project and occurs the hang.
>> > could u tell me how to resolve this issue.  is it ok to return to
> the
>> code
>> > which without "synchronized( &mutex )"
>> >
>> > thanks
>> > eric.
>> >
>> >
>> > Filip Hanik - Dev Lists wrote:
>> >
>> >> hi Eric,
>> >> this is classic dead lock, and it is a bug in AMQCPP, as Rob said,
> file
>> >> a bug fix, but here is what is going on
>> >>
>> >> thread 1, in line
>> >> #9 0x00506316 in
>> activemq::connector::openwire::OpenWireConnector::close
>> >>
>> >> it has acquired the lock
>> >> synchronized( &mutex )
>> >>
>> >> then it calls
>> >> transport->close();
>> >>
>> >> and this calls
>> >>
>> >> thread->join();
>> >>
>> >> thread in this case is your thread 2.
>> >>
>> >> thread 2, in line
>> >>
>> >> #16 0x0052678f in activemq::transport::IOTransport::run
>> (this=0xb7e02410)
>> >> at
>> >> has caught an exception and it invoking onTransportException,
>> >> and this is calling
>> >>
>> >>
> activemq::connector::openwire::OpenWireConnector::onTransportException
>> >>
>> >> and this is calling
>> >> synchronized( &mutex ) {
>> >>
>> >> and that's where the dead lock is put in place.
>> >>
>> >> this bug was introduced in
>> >> http://svn.apache.org/viewvc/activemq/activemq-
>>
> cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp?vie
> w=
>> diff&r1=630692&r2=630693
>> >>
>> >> when the mutex was added in, but the threading wasn't considered
>> >>
>> >>
>> >> Filip
>> >>
>> >>
>> >>
>> >>
>> >> [EMAIL PROTECTED] wrote:
>> >>
>> >>> we use ActiveMQ 2.2 now and the issus occurs again
>> >>>
>> >>> we have the thread info as follows:
>> >>> thread 1: the thread in our application which call the ActiveMQ
> cpp.
>> >>> #0  0x009517a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
>> >>> #1  0x001f20fd in pthread_join () from /lib/tls/libpthread.so.0
>> >>> #2  0x00d48b09 in apr_thread_join (retval=0xfffffffc,
> thd=0x82cda20)
>> at
>> >>> threadproc/unix/thread.c:217
>> >>> #3  0x00567b7f in decaf::lang::Thread::join (this=0xb7e026c8) at
>> >>> decaf/lang/Thread.cpp:87
>> >>> #4  0x00525e8d in activemq::transport::IOTransport::close
>> >>> (this=0xb7e02410)
>> >>> at activemq/transport/IOTransport.cpp:163
>> >>> #5  0x005314bb in
> activemq::transport::filters::TcpTransport::close
>> >>> (this=0xb7e01fe0) at ./activemq/transport/TransportFilter.h:209
>> >>> #6  0x0052edf1 in
>> activemq::transport::filters::AsyncSendTransport::close
>> >>> (this=0xb7e021e8) at
>> activemq/transport/filters/AsyncSendTransport.cpp:96
>> >>> #7  0x0052a9a5 in
>> activemq::transport::filters::ResponseCorrelator::close
>> >>> (this=0xb7e00878)
>> >>>     at activemq/transport/filters/ResponseCorrelator.cpp:252
>> >>> #8  0x0050166d in
>> >>> activemq::connector::openwire::OpenWireFormatNegotiator::close
>> >>> (this=0xb7e02610)
>> >>>     at
> activemq/connector/openwire/OpenWireFormatNegotiator.cpp:228
>> >>> #9  0x00506316 in
>> activemq::connector::openwire::OpenWireConnector::close
>> >>> (this=0xb7e019e8)
>> >>>     at activemq/connector/openwire/OpenWireConnector.cpp:177
>> >>> #10 0x005089db in ~OpenWireConnector (this=0xb7e019e8) at
>> >>> activemq/connector/openwire/OpenWireConnector.cpp:116
>> >>> #11 0x004ac5d0 in
>> >>> activemq::core::ActiveMQConnectionFactory::createConnection
>> >>> ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED],
>> >>>     [EMAIL PROTECTED]) at
>> >>> activemq/core/ActiveMQConnectionFactory.cpp:177
>> >>> #12 0x004acbf2 in
>> >>> activemq::core::ActiveMQConnectionFactory::createConnection
>> >>> (this=0xb7e00b38) at
> activemq/core/ActiveMQConnectionFactory.cpp:67
>> >>> #13 0x0807aefd in CCommonActiveMQConnector::CreateConnection
>> >>> (this=0xb7e01ce8) at CommonActiveMQConnector.cpp:358
>> >>>
>> >>> thread 2: the ActiveMQ thread.
>> >>> #0  0x009517a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
>> >>> #1  0x001f61de in __lll_mutex_lock_wait () from
>> /lib/tls/libpthread.so.0
>> >>> #2  0x001f2e47 in _L_mutex_lock_179 () from
> /lib/tls/libpthread.so.0
>> >>> #3  0x0237f1a8 in ?? ()
>> >>> #4  0x00d4d92c in ?? () from /opt/webex/tricon/bin/libapr-1.so.0
>> >>> #5  0xb7e01a3c in ?? ()
>> >>> #6  0x0237fbb0 in ?? ()
>> >>> #7  0x0237f1b8 in ?? ()
>> >>> #8  0x00d3dea7 in apr_thread_mutex_lock (mutex=0x82c58dc) at
>> >>> locks/unix/thread_mutex.c:92
>> >>> #9  0x00d3dea7 in apr_thread_mutex_lock (mutex=0x82c58d8) at
>> >>> locks/unix/thread_mutex.c:92
>> >>> #10 0x00581671 in decaf::util::concurrent::Mutex::lock
> (this=0x1f61de)
>> at
>> >>> decaf/util/concurrent/Mutex.cpp:53
>> >>> #11 0x00505349 in
>> >>>
> activemq::connector::openwire::OpenWireConnector::onTransportException
>> >>> (this=0xb7e019e8, source=0xb7e02610, [EMAIL PROTECTED])
>> >>>     at ./decaf/util/concurrent/Lock.h:94
>> >>> #12 0x00502331 in
>> >>>
>>
> activemq::connector::openwire::OpenWireFormatNegotiator::onTransportExce
> pt
>> ion
>> >>> (this=0xb7e02610, source=0xb7e00878, [EMAIL PROTECTED])
>> >>>     at ./activemq/transport/TransportFilter.h:74
>> >>> #13 0x00524919 in
>> >>> activemq::transport::TransportFilter::onTransportException
>> >>> (this=0xb7e00878, source=0xb7e021e8, [EMAIL PROTECTED])
>> >>>     at activemq/transport/TransportFilter.h:74
>> >>> #14 0x00524919 in
>> >>> activemq::transport::TransportFilter::onTransportException
>> >>> (this=0xb7e021e8, source=0xb7e01fe0, [EMAIL PROTECTED])
>> >>>     at activemq/transport/TransportFilter.h:74
>> >>> #15 0x00524919 in
>> >>> activemq::transport::TransportFilter::onTransportException
>> >>> (this=0xb7e01fe0, source=0xb7e02410, [EMAIL PROTECTED])
>> >>>     at activemq/transport/TransportFilter.h:74
>> >>> #16 0x0052678f in activemq::transport::IOTransport::run
>> (this=0xb7e02410)
>> >>> at
>> >>> activemq/transport/IOTransport.h:105
>> >>> #17 0x00567c59 in decaf::lang::Thread::runCallback
> (self=0x82cda20,
>> >>> param=0xb7e026c8) at decaf/lang/Thread.cpp:113
>> >>> #18 0x00d489a4 in dummy_worker (opaque=0xfffffffc) at
>> >>> threadproc/unix/thread.c:142
>> >>> #19 0x001f1371 in start_thread () from /lib/tls/libpthread.so.0
>> >>> #20 0x00853ffe in clone () from /lib/tls/libc.so.6
>> >>>
>> >>>
>> >>> [EMAIL PROTECTED] wrote:
>> >>>
>> >>>
>> >>>> thanks for caring,
>> >>>> the answer is :yes. we use activeMQ cpp 2.1.3 . and the version
> of
>> the
>> >>>> activeMq broker is 5.5.
>> >>>>
>> >>>>
>> >>>> rajdavies wrote:
>> >>>>
>> >>>>
>> >>>>> Do you mean the cpp client?  - what version is the activemq
> broker ?
>> >>>>>
>> >>>>> On 18 Aug 2008, at 07:48, [EMAIL PROTECTED] wrote:
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>> we use client activeMq2.1 .
>> >>>>>> the logic flow is as follows:
>> >>>>>> step1:there will be disconnection with activeMq server in about
> 5
>> >>>>>> minutes,
>> >>>>>> step2:a onexception to activeMQ client ,then client reconnect
> to
>> the
>> >>>>>> activeMQ server.
>> >>>>>> step3:reconnect ok and return to step1.
>> >>>>>> the issue is :after about 300--400 times  successful
> reconnection,
>> the
>> >>>>>> Client Hangs up.
>> >>>>>>
>> >>>>>> is there anyone know this issue and how to correct it
>> >>>>>> thanks.
>> >>>>>> --
>> >>>>>> View this message in context:
>> >>>>>> http://www.nabble.com/activeMq-hangs-after-long-time-using-
>> tp19026674p19026674.html
>> >>>>>> Sent from the ActiveMQ - Dev mailing list archive at
> Nabble.com.
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/activeMq-hangs-after-long-time-using-tp19026674p19118426.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Reply via email to