Issue Details (XML | Word | Printable)

Key: AMQ-1671
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Rob Davies
Reporter: Kevin Yaussy
Votes: 2
Watchers: 1
Operations

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

InactivityMonitor issue with regards to exceptions on a connection

Created: 17/Apr/08 12:10 PM   Updated: 24/Apr/08 06:09 AM
Return to search
Component/s: Broker, Connector, Transport
Affects Version/s: 5.1.0, 5.2.0
Fix Version/s: 5.1.0

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File InactivityMonitor.java 2008-04-17 12:10 PM Kevin Yaussy 11 kB

Patch Info: Patch Available


 Description  « Hide
I'm using the 4/16 5.2 SNAPSHOT code.

I'm reporting a new issue here, but this may be related or same as: AMQ-1482, and AMQ-1582.

The issue is that if there is an exception on a connection, such as the process goes away (could be an AMQBroker going away or a client process), the InactivityMonitor is not properly reporting this. If maxInactivityDuration is set to 0, and the client process goes away, the AMQBroker never cleans up anything for this client, and the client can never reconnect (it will get InvalidClientID exceptions). If maxInactivityDuration is non-zero, the connection will eventually get cleaned up when the inactivity timer pops.

The issue turns out to be this line of code in InactivityMonitor::onException

if (!failed.compareAndSet(false,true)) {

This means that when the connection goes away, this call returns true, but the if statement is negating that so the next two lines of code in onException are never executed at this time. Only later (if maxInactivityDuration is non-zero) will this check result in true, such that the next two lines in onException are called.

I think that this is just an issue in misinterpreting what AtomicBoolean will return for the compareAndSet method? Assuming this to be the case, I changed this line to take out the "!". Now everything works exactly as it should.

I've attached the changed source.



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.