Issue Details (XML | Word | Printable)

Key: AMQ-932
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: John Heitmann
Votes: 0
Watchers: 0
Operations

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

Quickly broken client connections lead to memory leaks

Created: 21/Sep/06 12:19 AM   Updated: 25/Sep/06 04:23 AM
Return to search
Component/s: Broker
Affects Version/s: 4.0.2
Fix Version/s: 4.1.0

Time Tracking:
Not Specified

File Attachments:
  Size
File 73.diff 2006-09-21 12:19 AM John Heitmann 3 kB

Patch Info: Patch Available


 Description  « Hide
Connections to the openwire port that are pathologically broken (for example any http request) or that die in some other way extremely quickly will lead to memory losses of aout 64Kb each time. This happens because many services are stop()ed directly in the middle of start(), and then never stopped for real, or stopped again but on an object tree with an inconsistent state. This is usually also accompanied by the JMX message:

WARN ManagedTransportConnection - Failed to unregister mbean: org.apache.activemq:BrokerName=localhost,Type=Connection,ConnectorName=default,Connection=25

But that is a cosmetic symptom and not critical (and this has otherwise nothing to do with JMX).

My patch is a band-aid that is functional but I'm not very happy with it. The patch changes some service logic so that if stop is called in the middle of start, the stop is instead queued and called at the end of start. There will still be multiple stops, and you'll still see the cosmetic JMX error from the second ineffectual stop, but the first stop cleans up correctly so there are no leaks.

I think there's probably a better solution, but it was tough to see what. I'd appreciate better ideas. Possibly something involving moving the dangerous operations (wire format negotiation etc) out of start?

I am working on a unit test, but I can't promise I will have something to submit. I'm having to play JVM games to detect the problem in a unit test and that might not fly for general purpose use.



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
James Strachan made changes - 25/Sep/06 04:23 AM
Field Original Value New Value
Resolution Fixed [ 1 ]
Fix Version/s 4.1 [ 11691 ]
Status Open [ 1 ] Resolved [ 5 ]