activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: C++ Client crashes on reconnect after migration from 2.1.3 to 3.0.1
Date Wed, 07 Oct 2009 11:37:30 GMT
On Tue, 2009-10-06 at 23:53 -0700, rainy3 wrote:
> Hello,
> 
> After migration from AMQCPP 2.1.3 to 3.0.1 (compiled with gcc 4.1.2 and apr
> v1.3.9) our client is no longer able to properly recovery (reconnect) after
> Broker restart. On recconnect first it tries to recreate all AMQ objects
> like this:
>     if (mDestination)
>     {
>         try{ delete mDestination; } catch( ... ) {}
>         mDestination = NULL;
>     }
> 
>     if (mConsumer)
>     {
>         try{ delete mConsumer; } catch( ... ) {}
>         mConsumer = NULL;
>     }
> 
>     if ( mConnection != NULL )
>     {
>         try{ delete mConnection; } catch( ... ) {}
>         mConnection = NULL;
>     }
> 
> When it tries to delete mConnection it gets (and aborts):
> terminate called after throwing an instance of
> 'activemq::exceptions::ActiveMQException'
>   what():  decaf::net::SocketOutputStream::write - This Stream has been
> closed.
> Aborted
> 
> Backtrace looks like this:
> #0  0x0000003137830045 in raise () from /lib64/libc.so.6
> #1  0x0000003137831ae0 in abort () from /lib64/libc.so.6
> #2  0x0000003039cbec34 in __gnu_cxx::__verbose_terminate_handler () from
> /usr/lib64/libstdc++.so.6
> #3  0x0000003039cbcdf6 in std::set_unexpected () from
> /usr/lib64/libstdc++.so.6
> #4  0x0000003039cbce23 in std::terminate () from /usr/lib64/libstdc++.so.6
> #5  0x0000003039cbce36 in std::terminate () from /usr/lib64/libstdc++.so.6
> #6  0x0000003039cbc888 in __cxa_call_unexpected () from
> /usr/lib64/libstdc++.so.6
> #7  0x00002aaaae11edaf in activemq::transport::IOTransport::close () from
> ./libactivemq-cpp.so.9
> #8  0x00002aaaae120e11 in activemq::transport::TransportFilter::close ()
> from ./libactivemq-cpp.so.9
> #9  0x00002aaaae14bd53 in activemq::transport::tcp::TcpTransport::close ()
> from ./libactivemq-cpp.so.9
> #10 0x00002aaaae1705b5 in
> activemq::wireformat::openwire::OpenWireFormatNegotiator::close () from
> ./libactivemq-cpp.so.9
> #11 0x00002aaaae12480f in
> activemq::transport::correlator::ResponseCorrelator::close () from
> ./libactivemq-cpp.so.9
> #12 0x00002aaaae0af358 in
> activemq::core::ActiveMQConnectionSupport::shutdownTransport () from
> ./libactivemq-cpp.so.9
> #13 0x00002aaaae0afbd3 in
> activemq::core::ActiveMQConnectionSupport::~ActiveMQConnectionSupport$base
> () from ./libactivemq-cpp.so.9
> #14 0x00002aaaae09c489 in
> activemq::core::ActiveMQConnection::~ActiveMQConnection$delete () from
> ./libactivemq-cpp.so.9
> 
> After some research i discover that there is a huge difference between
> exceptions hierarchy between versions 3.0.1 and 2.1.3:
> 3.0.1
> ActiveMQException - decaf::lang::Exception - Throwable - std::exception
> CMSException - std::exception
> 
> 2.1.3
> ActiveMQException - cms::CMSException 
> CMSException - std::exception
> 
> IOTransport::close looks like this:
> void IOTransport::close() throw( cms::CMSException ) { 
>     ...
>     AMQ_CATCH_RETHROW( ActiveMQException )
>     AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
>     AMQ_CATCHALL_THROW( ActiveMQException ) 
> }
> 
> and i quess that's a reason of abort. Is there any way to avoid this?

This issue was addressed recently so you can get the latest SVN version
which has the fix in it.

Regards
Tim.


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message