activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQCPP-361) Destroying a consumer may cause a crash
Date Thu, 14 Apr 2011 12:49:05 GMT

    [ https://issues.apache.org/jira/browse/AMQCPP-361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13019810#comment-13019810
] 

Timothy Bish commented on AMQCPP-361:
-------------------------------------

This is a bit of a usage issue as much as a bug, C++ object lifetime is not like Java or other
Garbage collected languages.  Its a best practice to close each of the CMS resources before
deleting them.  Locking the dispatch in the session executor would lead to a deadlock in failover
cases, so I'd say its preferable to have to take a bit more care when tearing down your objects
then have deadlocks.

> Destroying a consumer may cause a crash
> ---------------------------------------
>
>                 Key: AMQCPP-361
>                 URL: https://issues.apache.org/jira/browse/AMQCPP-361
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl
>    Affects Versions: 3.2.5
>         Environment: all
>            Reporter: Teemu Torma
>            Assignee: Timothy Bish
>
> ActiveMQSessionExecutor::dispatch gets a consumer and calls consumer's dispatch method
without holding any locks in between.  This leaves a window when a consumer can be no longer
valid on a dispatch call causing a crash.
> Since this is a timing issue it is hard to demonstrate as such.  If one adds let's say
one second sleep in ActiveMQSessionExecutor::dispatch before the call to the consumer->dispatch,
and destroys a consumer on a destination which has messages incoming will likely crash the
application.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message