Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 69028 invoked from network); 19 May 2008 15:16:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 May 2008 15:16:34 -0000 Received: (qmail 84322 invoked by uid 500); 19 May 2008 15:16:35 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 84270 invoked by uid 500); 19 May 2008 15:16:35 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 84259 invoked by uid 99); 19 May 2008 15:16:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 May 2008 08:16:35 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 May 2008 15:15:49 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 203D2234C118 for ; Mon, 19 May 2008 08:16:09 -0700 (PDT) Message-ID: <990831277.1211210169130.JavaMail.jira@brutus> Date: Mon, 19 May 2008 08:16:09 -0700 (PDT) From: "Timothy Bish (JIRA)" To: dev@activemq.apache.org Subject: [jira] Resolved: (AMQCPP-174) Deadlock on transacted session In-Reply-To: <71375912.1208223583457.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQCPP-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Timothy Bish resolved AMQCPP-174. --------------------------------- Assignee: Timothy Bish (was: Nathan Mittler) Resolution: Fixed Made some changes to the session executer that seems to have resolved the dedlock issue. Changes are in SVN rev: 657835 > Deadlock on transacted session > ------------------------------ > > Key: AMQCPP-174 > URL: https://issues.apache.org/activemq/browse/AMQCPP-174 > Project: ActiveMQ C++ Client > Issue Type: Bug > Components: CMS Impl > Affects Versions: 2.1.3 > Environment: Windows XP > Visual Studio 2003 & 2005 > activemq-cpp 2.1.3 > apache-activemq 5.0.0 > Reporter: Nick Cooper > Assignee: Timothy Bish > Fix For: 2.2 > > Attachments: request_response.zip > > > I am implementing a request/response client and require the ability to do transactions. I initially created one connection with one session with a producer and a consumer. This worked fine when creating the session with Session::AUTO_ACKNOWLEDGE. When I changed this to use Session::SESSION_TRANSACTED > with session->commit() the application stopped working. To help work out the issue I created separate connections and sessions for the producer and consumer which did not help. > Looking at the application in the debugger it looks like when session->commit() is called, a dead lock occurs. > In ActiveMQSessionExecutor::stop() the following line is executed: > // Wakeup the thread so that it can acknowledge the stop request. > mutex.notifyAll(); > but eventQ.size() is 0, that is no thread is notified. The next line is then executed: > // Wait for the thread to notify us that it has acknowledged > // the stop request. > mutex.wait(); > but there is no other thread to ever come and wake it up, thus it hangs and the session is never committed. > Am I using the API incorrectly or is this a real issue? > Note this looks very similar to issue 155 https://issues.apache.org/activemq/browse/AMQCPP-155 > Thread Summary > -------------- > 2000 main tool::DefaultCounter::`scalar deleting destructor' Normal 0 > 1896 _threadstartex activemq::concurrent::Mutex::wait Normal 0 > 3984 _threadstartex activemq::network::SocketInputStream::read Normal 0 > > 1544 _threadstartex activemq::concurrent::Mutex::notifyAll Normal 0 > Thread 1544 Stacktrace.... > > ppl_worker_d.exe!activemq::concurrent::Mutex::notifyAll() Line 233 C++ > ppl_worker_d.exe!activemq::core::ActiveMQSessionExecutor::stop() Line 150 + 0x11 C++ > ppl_worker_d.exe!activemq::core::ActiveMQSession::stop() Line 847 + 0x1b C++ > ppl_worker_d.exe!activemq::core::ActiveMQTransaction::commit() Line 205 C++ > ppl_worker_d.exe!activemq::core::ActiveMQSession::commit() Line 150 + 0x13 C++ > ppl_worker_d.exe!dist::TransactedConnector::onMessage(const cms::Message * message=0x014df8c0) Line 176 + 0x30 C++ > ppl_worker_d.exe!activemq::core::ActiveMQConsumer::dispatch(activemq::core::DispatchData & data={...}) Line 429 + 0x3a C++ > ppl_worker_d.exe!activemq::core::ActiveMQSessionExecutor::dispatch(activemq::core::DispatchData & data={...}) Line 188 + 0x15 C++ > ppl_worker_d.exe!activemq::core::ActiveMQSessionExecutor::dispatchAll() Line 273 + 0x11 C++ > ppl_worker_d.exe!activemq::core::ActiveMQSessionExecutor::run() Line 213 C++ > ppl_worker_d.exe!activemq::concurrent::Thread::runCallback(void * param=0x014dc3e8) Line 152 + 0x13 C++ > msvcr71d.dll!_threadstartex(void * ptd=0x014df798) Line 241 + 0xd C > kernel32.dll!7c80b683() > Thread 3984 Stacktrace.... > > ppl_worker_d.exe!activemq::network::SocketInputStream::read(unsigned char * buffer=0x014d8f70, unsigned int bufferSize=1) Line 152 + 0x19 C++ > ppl_worker_d.exe!activemq::io::BufferedInputStream::bufferData() Line 190 + 0x2c C++ > ppl_worker_d.exe!activemq::io::BufferedInputStream::read(unsigned char * targetBuffer=0x017ff6f4, unsigned int targetBufferSize=4) Line 125 C++ > ppl_worker_d.exe!activemq::io::DataInputStream::readAllData(unsigned char * buffer=0x017ff6f4, unsigned int length=4) Line 369 + 0x21 C++ > ppl_worker_d.exe!activemq::io::DataInputStream::readInt() Line 168 C++ > ppl_worker_d.exe!activemq::connector::openwire::OpenWireFormat::unmarshal(activemq::io::DataInputStream * dis=0x014dcbe8) Line 218 + 0xd C++ > ppl_worker_d.exe!activemq::connector::openwire::OpenWireCommandReader::readCommand() Line 71 + 0x1a C++ > ppl_worker_d.exe!activemq::transport::IOTransport::run() Line 166 + 0x13 C++ > ppl_worker_d.exe!activemq::concurrent::Thread::runCallback(void * param=0x014dce40) Line 152 + 0x13 C++ > msvcr71d.dll!_threadstartex(void * ptd=0x014ddd10) Line 241 + 0xd C > kernel32.dll!7c80b683() > Thread 1896 Stacktrace.... > > ppl_worker_d.exe!activemq::concurrent::Mutex::wait(unsigned long millisecs=4294967295) Line 178 + 0x10 C++ > ppl_worker_d.exe!activemq::concurrent::Mutex::wait() Line 102 + 0xf C++ > ppl_worker_d.exe!activemq::util::Queue::wait() Line 206 + 0x11 C++ > ppl_worker_d.exe!activemq::transport::filters::AsyncSendTransport::run() Line 118 + 0x11 C++ > ppl_worker_d.exe!activemq::concurrent::Thread::runCallback(void * param=0x014dcad0) Line 152 + 0x13 C++ > msvcr71d.dll!_threadstartex(void * ptd=0x014dcd78) Line 241 + 0xd C > kernel32.dll!7c80b683() -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.