[MGNLOBS-14] Leftover threads when unregistering listeners. Created: 11/Jul/12  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Observation
Component/s: None
Affects Version/s: 1.2
Fix Version/s: 1.3.x, 2.0.x

Type: Bug Priority: Neutral
Reporter: Danilo Ghirardelli Assignee: Unassigned
Resolution: Won't Do Votes: 1
Labels: cleanup, listener, thread
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MAGNOLIA-4456 Leftover Jackrabbit thread after shut... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

"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.



 Comments   
Comment by Edgar Vonk [ 13/Apr/15 ]

Hi Magnolia, any news on this issue at all?

Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

Generated at Mon Feb 12 10:23:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.