[MAGNOLIA-8380] CLONE - Add debug logging for tracking SystemRepositoryStrategy instances Created: 15/Apr/22  Updated: 24/Jun/22  Resolved: 24/Jun/22

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: 6.3.0

Type: Improvement Priority: Neutral
Reporter: Michael Duerig Assignee: Michael Duerig
Resolution: Not an issue Votes: 0
Labels: foundation_team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
clones MAGNOLIA-8362 Add debug logging for tracking System... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes

 Description   

This ticket was opened to be sure this get's ported to 6.3. (see MAGNOLIA-8362)

Original Description

MGNLEE-645 reported a thread local leak of SystemRepositoryStrategy instances on shutdown:

org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [magnoliaAuthor] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7d3d101b]) 
and a value of type [info.magnolia.context.SystemRepositoryStrategy] (value [info.magnolia.context.SystemRepositoryStrategy@5cdec700]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

So far we were not able to reliably reproduce the problem.

For making it easier to diagnose the problem we should implement additional logging to make above warning more helpful. Instead of logging SystemRepositoryStrategy@5cdec700 we should log the stack trace from the time the affected SystemRepositoryStrategy instance was created.



 Comments   
Comment by Michael Duerig [ 24/Jun/22 ]

This feature is already in 6.3: https://git.magnolia-cms.com/projects/PLATFORM/repos/main/commits/bbb2ef29a28feaf3b52703e471eb0f874481d148

Generated at Mon Feb 12 04:32:13 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.