Leftover threads when unregistering listeners.
----------------------------------------------

                 Key: MGNLOBS-14
                 URL: http://jira.magnolia-cms.com/browse/MGNLOBS-14
             Project: Magnolia Observation Module
          Issue Type: Bug
    Affects Versions: 1.2
            Reporter: Danilo Ghirardelli
            Assignee: Teresa Miyar


"Macro" problem: if you have the observation module in your Magnolia and 
restart the webapp a few times (without stopping the application server), you 
will notice that with each restart a bunch of threads are left "orphaned" by 
the observation module, thus wasting the thread pool.

The root of the problem is that deeply down, the Obervation module uses the 
{{ClockDaemon}} class (from oswego) as handler for delayed operations. This 
class has a {{shutDown()}} method which unfortunately is never called, so if 
the thread is not catched by garbage colletion is left there forever.

A possible solution for the problem is to add a {{shutdown}} method in the 
{{DelayedExecutor}} class (that would call the {{ClockDaemon.shutdown}}), and 
then a corresponding {{shutdown}} up to the call chain 
({{ObservationBasedDelayedExecutor}}, {{DeferringEventListener}}). With this it 
will be possible to call that shutdown method when unregistering an event 
listener in {{ObservationUtil.unregisterChangeListener}}.
If all the listener are correctly unregistered during application shutdown 
(which seems to be the case), there won't be leftover threads.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to