Bug 1076258 - [AS7] plugin's connection cleaner leaks classloader
Summary: [AS7] plugin's connection cleaner leaks classloader
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: GA
: RHQ 4.11
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 1077943
TreeView+ depends on / blocked
 
Reported: 2014-03-13 23:46 UTC by Lukas Krejci
Modified: 2014-07-21 10:13 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
: 1077943 (view as bug list)
Environment:
Last Closed: 2014-07-21 10:13:34 UTC
Embargoed:


Attachments (Terms of Use)

Description Lukas Krejci 2014-03-13 23:46:00 UTC
Description of problem:

ASConnection has a static thread pool which runs connection "cleaners" to prevent connection leakage.

On every plugin container restart, the classes of the plugin are loaded anew, but the above thread pool is never shut down, leaving a thread running with a context classloader from the previous plugin container run.

This leads to an eventual OOME because of depleted perm gen memory needed to hold all the classes from all the plugin container runs in the agent's lifetime.

This problem has been made more apparent by our switch to HTTP client which is a much heavier library than the java's own Authenticator and HTTPUrlConnection we used before (but which had their own deal of problems).

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

How reproducible:
always

Steps to Reproduce:
1. inventory an AS7
2. periodically restart the plugin container without fully restarting the agent

Actual results:
out of memory error after a couple of repetitions (>10 usually, but depends on your perm gen set up)

Expected results:
no OOMEs

Additional info:

Comment 1 Lukas Krejci 2014-03-14 01:44:44 UTC
commit 9d8b107414e926361ff2b7501e2094402de8e7f7
Author: Lukas Krejci <lkrejci>
Date:   Fri Mar 14 02:42:44 2014 +0100

    [BZ 1076258] Fix classloader leak in as7 plugin
    
    The plugin-wide thread pool for closing stale connections was leaving
    threads running and those threads held on to the "old" plugin classloaders
    from previous plugin container "runs".
    
    The AS7 plugin now has a plugin lifecycle listener that shuts down that
    thread pool preventing that leak from happening.

Comment 2 Heiko W. Rupp 2014-07-21 10:13:34 UTC
Bulk closing of RHQ 4.11 issues, now that RHQ 4.12 is out.

If you find an issue with those, please open a new BZ, linking to the old one.


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