You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Daniel Laügt (JIRA)" <ji...@apache.org> on 2013/10/15 10:25:42 UTC

[jira] [Updated] (AMQCPP-520) AMQ crashes when an exception comes during the connection closure

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

Daniel Laügt updated AMQCPP-520:
--------------------------------

    Description: 
>From one thread, an exception comes and FailoverTransport::handleTransportFailure () is called:

activemq::transport::failover::CloseTransportsTask::add(const Pointer<Transport> transport)
activemq::transport::failover::FailoverTransport::handleTransportFailure(const decaf::lang::Exception & error={...})
activemq::transport::failover::FailoverTransportListener::onException(const decaf::lang::Exception & ex={...})
activemq::transport::TransportFilter::onException(const decaf::lang::Exception & ex={...})
activemq::wireformat::openwire::OpenWireFormatNegotiator::onException(const decaf::lang::Exception & ex={...})
activemq::transport::TransportFilter::onException(const decaf::lang::Exception & ex={...})
activemq::transport::inactivity::InactivityMonitor::onException(const decaf::lang::Exception & ex={...})
activemq::transport::TransportFilter::onException(const decaf::lang::Exception & ex={...})
activemq::transport::IOTransport::fire(decaf::lang::Exception & ex={...})
activemq::transport::IOTransport::run()
decaf::lang::Thread::run()


>From another thread, the amq connection is being closed. It destructs the FailoverTransport without waiting that the first thread finishes to call handleTransportFailure():

activemq::transport::failover::FailoverTransport::~FailoverTransport()
activemq::transport::failover::FailoverTransport::`vector deleting destructor'(unsigned int)
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::onDeleteFunc(activemq::transport::Transport * value=0x02f307b0)
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::~Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>()
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::reset(activemq::transport::Transport * value=0x00000000)
activemq::transport::TransportFilter::~TransportFilter()
activemq::transport::correlator::ResponseCorrelator::~ResponseCorrelator()
activemq::transport::correlator::ResponseCorrelator::`vector deleting destructor'(unsigned int)
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::onDeleteFunc(activemq::transport::Transport * value=0x03ba6058)
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::~Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>()
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::reset(activemq::transport::Transport * value=0x00000000)
activemq::core::ActiveMQConnection::disconnect(__int64 lastDeliveredSequenceId=0)
activemq::core::ActiveMQConnection::close()


I don't have any simple test case as it is a race condition.
I've attached a proposal patch.


  was:
>From one thread, an exception comes and FailoverTransport::handleTransportFailure () is called:

activemq::transport::failover::CloseTransportsTask::add(const Pointer<Transport> transport)
activemq::transport::failover::FailoverTransport::handleTransportFailure(const decaf::lang::Exception & error={...})
activemq::transport::failover::FailoverTransportListener::onException(const decaf::lang::Exception & ex={...})
activemq::transport::TransportFilter::onException(const decaf::lang::Exception & ex={...})
activemq::wireformat::openwire::OpenWireFormatNegotiator::onException(const decaf::lang::Exception & ex={...})
activemq::transport::TransportFilter::onException(const decaf::lang::Exception & ex={...})
activemq::transport::inactivity::InactivityMonitor::onException(const decaf::lang::Exception & ex={...})
activemq::transport::TransportFilter::onException(const decaf::lang::Exception & ex={...})
activemq::transport::IOTransport::fire(decaf::lang::Exception & ex={...})
activemq::transport::IOTransport::run()
decaf::lang::Thread::run()

>From another thread, the amq connection is being closed. It destructs the FailoverTransport without waiting that the first thread finishes to call handleTransportFailure():

activemq::transport::failover::FailoverTransport::~FailoverTransport()
activemq::transport::failover::FailoverTransport::`vector deleting destructor'(unsigned int)
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::onDeleteFunc(activemq::transport::Transport * value=0x02f307b0)
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::~Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>()
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::reset(activemq::transport::Transport * value=0x00000000)
activemq::transport::TransportFilter::~TransportFilter()
activemq::transport::correlator::ResponseCorrelator::~ResponseCorrelator()
activemq::transport::correlator::ResponseCorrelator::`vector deleting destructor'(unsigned int)
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::onDeleteFunc(activemq::transport::Transport * value=0x03ba6058)
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::~Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>()
decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::reset(activemq::transport::Transport * value=0x00000000)
activemq::core::ActiveMQConnection::disconnect(__int64 lastDeliveredSequenceId=0)
activemq::core::ActiveMQConnection::close()

I don't have any simple test case as it is a race condition.
I've attached a proposal patch.



> AMQ crashes when an exception comes during the connection closure
> -----------------------------------------------------------------
>
>                 Key: AMQCPP-520
>                 URL: https://issues.apache.org/jira/browse/AMQCPP-520
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 3.6.0
>         Environment: Solaris 10 with gcc 3.4.6
>            Reporter: Daniel Laügt
>            Assignee: Timothy Bish
>            Priority: Minor
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> From one thread, an exception comes and FailoverTransport::handleTransportFailure () is called:
> activemq::transport::failover::CloseTransportsTask::add(const Pointer<Transport> transport)
> activemq::transport::failover::FailoverTransport::handleTransportFailure(const decaf::lang::Exception & error={...})
> activemq::transport::failover::FailoverTransportListener::onException(const decaf::lang::Exception & ex={...})
> activemq::transport::TransportFilter::onException(const decaf::lang::Exception & ex={...})
> activemq::wireformat::openwire::OpenWireFormatNegotiator::onException(const decaf::lang::Exception & ex={...})
> activemq::transport::TransportFilter::onException(const decaf::lang::Exception & ex={...})
> activemq::transport::inactivity::InactivityMonitor::onException(const decaf::lang::Exception & ex={...})
> activemq::transport::TransportFilter::onException(const decaf::lang::Exception & ex={...})
> activemq::transport::IOTransport::fire(decaf::lang::Exception & ex={...})
> activemq::transport::IOTransport::run()
> decaf::lang::Thread::run()
> From another thread, the amq connection is being closed. It destructs the FailoverTransport without waiting that the first thread finishes to call handleTransportFailure():
> activemq::transport::failover::FailoverTransport::~FailoverTransport()
> activemq::transport::failover::FailoverTransport::`vector deleting destructor'(unsigned int)
> decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::onDeleteFunc(activemq::transport::Transport * value=0x02f307b0)
> decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::~Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>()
> decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::reset(activemq::transport::Transport * value=0x00000000)
> activemq::transport::TransportFilter::~TransportFilter()
> activemq::transport::correlator::ResponseCorrelator::~ResponseCorrelator()
> activemq::transport::correlator::ResponseCorrelator::`vector deleting destructor'(unsigned int)
> decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::onDeleteFunc(activemq::transport::Transport * value=0x03ba6058)
> decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::~Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>()
> decaf::lang::Pointer<activemq::transport::Transport,decaf::util::concurrent::atomic::AtomicRefCounter>::reset(activemq::transport::Transport * value=0x00000000)
> activemq::core::ActiveMQConnection::disconnect(__int64 lastDeliveredSequenceId=0)
> activemq::core::ActiveMQConnection::close()
> I don't have any simple test case as it is a race condition.
> I've attached a proposal patch.



--
This message was sent by Atlassian JIRA
(v6.1#6144)