History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: AMQ-1119
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Rob Davies
Reporter: Chris Hofstaedter
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

Deadlock in MutexTransport on shutdown with high volume of messages

Created: 05/Jan/07 06:48 AM   Updated: 26/Feb/07 09:05 AM
Component/s: Transport
Affects Version/s: 4.0, 4.0.1, 4.0.2
Fix Version/s: 5.0.0, 4.1.1

Time Tracking:
Not Specified

Environment: Windows XP, demand forwarding, failover == true


 Description  « Hide
I ran into a deadlock in the MutextTransport.oneway(Command command) function when processing very high message volume (100% cpu utilization) at the time of a shutdown. I'm running 4.0.2 on WinXP and within a demand forwarding environment with failover = true.

I did trap this deadlock in the debugger and it looks like two commands are crossing paths in opposite directions through the MutexTransport. One of the commands is a MessageDispatch and the other is a ShutdownInfo. Now, when the ShutdownInfo gets through the MutexTransport first, it tries to shutdown the background thread of the TcpTransport. However, this thread is currently servicing the MessageDispatch and is blocked on the MutexTransport. Deadlock.

So, my patch was simply to avoid entering the synchronized(writeMutex) block in the oneway(Command command) function of MutexTransport if
command.isShutdownInfo() returns true:

if (command.isShutdownInfo())
next.oneway(command);
else
synchronized(writeMutex) { next.oneway(command); }



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Rob Davies - 06/Jan/07 01:16 PM
Fixed by SVN revision 493573

Jonas Lim - 06/Jan/07 08:43 PM
applied fix in 4.0 branch : 493644

James Strachan - 26/Feb/07 09:05 AM
backported to 4.1 branch: 511900