Bug 848938 - JMX Plugin - Leaking connector threads - com.sun.jmx.remote.internal.ClientCommunicatorAdminClientCommunicatorAdmin$Checker.run
Summary: JMX Plugin - Leaking connector threads - com.sun.jmx.remote.internal.ClientCo...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: RHQ 4.5.0
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 871610
TreeView+ depends on / blocked
 
Reported: 2012-08-16 21:08 UTC by Elias Ross
Modified: 2013-09-01 09:58 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
: 871610 (view as bug list)
Environment:
Last Closed: 2013-09-01 09:58:33 UTC
Embargoed:


Attachments (Terms of Use)
fixes connection leak patch (6.43 KB, patch)
2012-09-13 22:01 UTC, Elias Ross
no flags Details | Diff
updated patch against master - 9f175839392 (11.18 KB, application/octet-stream)
2012-09-19 16:01 UTC, Elias Ross
no flags Details

Description Elias Ross 2012-08-16 21:08:32 UTC
Description of problem:

Number of process threads increases over time.

One such example:

"Thread-2461" daemon prio=10 tid=0x000000006103c800 nid=0x5fc0 waiting on condition [0x00002aab178bb000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at com.sun.jmx.remote.internal.ClientCommunicatorAdmin$Checker.run(ClientCommunicatorAdmin.java:154)
        at java.lang.Thread.run(Thread.java:619)



Version-Release number of selected component (if applicable):

RHQ 4.4 version of the plugin running.


How reproducible:

Unclear what specific conditions cause this in my case, but I have seen it almost universally. It could be to discovery failing.

There are obvious code paths which can likely lead to this condition worth exploring.


Additional info:

See: http://stackoverflow.com/questions/564589/dynamic-proxies-with-jmx-can-cause-thread-leaks
> When you do:
> JMXConnectorFactory.connect(url)
> Make sure to close it when you're done using it rather than leaving it up to garbage collection or it seems they can keep piling up...


There are two instances where close is never called:
1) Getting Java version
2) Getting Java PID

** patch forthcoming

Comment 1 Elias Ross 2012-09-13 22:01:15 UTC
Created attachment 612647 [details]
fixes connection leak patch

Comment 2 John Mazzitelli 2012-09-19 10:55:33 UTC
Tried applying the patch - it failed on current master (which is 6887631b) - please correct and re-attach to this BZ. Here's the error I get:

$ git am ~/Downloads/0001-Bug-848938-JMX-Plugin-Leaking-connector-thread.patch
Applying: Bug 848938 - JMX Plugin - Leaking connector thread
error: patch failed: modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXDiscoveryComponent.java:335
error: modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXDiscoveryComponent.java: patch does not apply
Patch failed at 0001 Bug 848938 - JMX Plugin - Leaking connector thread

Comment 3 Elias Ross 2012-09-19 16:01:58 UTC
Created attachment 614447 [details]
updated patch against master - 9f175839392

Comment 4 John Mazzitelli 2012-09-19 16:30:42 UTC
git commit to master: 26b37482f90fb01a6771c5c51471e2754dc3cdb4

Comment 5 Charles Crouch 2012-10-30 20:51:33 UTC
Set Target Release correctly.

Comment 6 Heiko W. Rupp 2013-09-01 09:58:33 UTC
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.


Note You need to log in before you can comment on or make changes to this bug.