[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: |
|
||||||||
| 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. |
| 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:
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, |