Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-06 Thread Grzegorz Grzybek
Hello I've updated PAXLOGGING-244 issue and I'm just releasing pax-logging 1.10.7. regards Grzegorz Grzybek wt., 5 maj 2020 o 21:13 Monica Ron napisał(a): > Hi. The new checkin looks much better, and matches what I have from my > patch. > > Please go ahead and release 1.10.7 with the updated

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-05 Thread Monica Ron
Hi. The new checkin looks much better, and matches what I have from my patch. Please go ahead and release 1.10.7 with the updated code. You might want to mention in the Release Notes that PAXLOGGING-244 (the ThreadContext problem) is now fixed on the 1.10.x branch (and/or update the "Fix

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-04 Thread Grzegorz Grzybek
Hello again ;) Thanks for detailed check! I confess - I wasn't able to do `git apply < xxx.patch`, so I did it manually and: - I forgot about changing the clear() to removal of "bundle.*" entries - I didn't notice double put() This time I did 2nd review and here's the result:

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-04 Thread Monica Ron
Hi. I very much appreciate the update and the new release. Thank you. I'm glad that the memory leak patch helped and that you could see from your updated tests what I had seen regarding leaks. *I hate to tell you this, but you'll need to make some fixes and release 1.10.x again.* *First*, you

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-04 Thread Jean-Baptiste Onofré
Good, thanks for the update. Regards JB On Mon, May 4, 2020 at 10:43 AM Grzegorz Grzybek wrote: > Hello > > Nope, it's not. Though I've enhanced the memory-related tests. And I'll > prepare new 1.11.x/2.0.x releases too, because of > https://ops4j1.jira.com/browse/PAXLOGGING-312 == >

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-04 Thread Grzegorz Grzybek
Hello Nope, it's not. Though I've enhanced the memory-related tests. And I'll prepare new 1.11.x/2.0.x releases too, because of https://ops4j1.jira.com/browse/PAXLOGGING-312 == https://issues.apache.org/jira/browse/LOG4J2-2819 == CVE-2020-9488 soon. regards Grzegorz Grzybek pon., 4 maj 2020 o

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-04 Thread Jean-Baptiste Onofré
Hi Grzegorz, Pax Logging 1.11.x is not impacted ? Regards JB On Mon, May 4, 2020 at 10:40 AM Grzegorz Grzybek wrote: > Hello again > > Without waiting, I've just released pax-logging 1.10.6 version - I hope > it'll solve all your (Monica Ron) problems ;) > > regards > Grzegorz Grzybek > >

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-04 Thread Grzegorz Grzybek
Hello again Without waiting, I've just released pax-logging 1.10.6 version - I hope it'll solve all your (Monica Ron) problems ;) regards Grzegorz Grzybek pon., 4 maj 2020 o 09:10 Grzegorz Grzybek napisał(a): > Hello³ > > And finally - many many thanks for your patch! I'm grateful because

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-04 Thread Grzegorz Grzybek
Hello³ And finally - many many thanks for your patch! I'm grateful because after applying your patch without changes, my Memory tests (extended to cover all remaining logging APIs/facades) pass without memory leaks on -Xmx64m. The change is:

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-04 Thread Grzegorz Grzybek
Hello² In Pax Logging 1.10.x it's not that good. - org.ops4j.pax.logging.log4jv2.Log4jv2Logger - 10001 instances - ok - org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl - 10010 instances - ok - org.apache.logging.log4j.core.Logger - 10010 instances - ok -

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-05-04 Thread Grzegorz Grzybek
Hello FYI, I've changed the memory tests to do logging via 7 "frontends" for each of 3 "backends". These frontends are: org.slf4j.Logger slf4jLogger = org.slf4j.LoggerFactory.getLogger(name); slf4jLogger.trace("TRACE through SLF4J"); org.apache.commons.logging.Log commonsLogger =

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-04-21 Thread Grzegorz Grzybek
Thanks! Definitely I'll use these patches to fix it in the project. regards and stay healthy! Grzegorz Grzybek wt., 21 kwi 2020 o 14:30 Monica Ron napisał(a): > Thanks. I decided to change my approach. I am not using the previous patch > anymore. > > I patched the ThreadContext (based on

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-04-21 Thread Monica Ron
Thanks. I decided to change my approach. I am not using the previous patch anymore. I patched the ThreadContext (based on PAXLOGGING-244), reworked my code to use the ThreadContext instead of modifying the logger name, and also made some changes to the pax-logging-api to fix some of the leak

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-04-21 Thread Grzegorz Grzybek
Hello Sorry for big delay... I still remember about this issue and I think I can do something about it soon. Just a little bit patience please ;) regards Grzegorz Grzybek śr., 18 mar 2020 o 22:47 Monica Ron napisał(a): > I have a test that shows my groups usage. Should I just attach it as a >

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-18 Thread Monica Ron
I have a test that shows my groups usage. Should I just attach it as a part of a post to this forum? It definitely behaves differently with the 1.10.5 vs. with my patch, with regards to how many logger instances get stored in m_loggers (especially if I use Log4J1 vs. Log4J2 as my API). I use

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-17 Thread Monica Ron
It took me some time to figure out how to run the tests. For one thing, it didn't like the fact that I wasn't using the default repository (I wasn't using .m2/repository in my home directory). Eventually, I got it working by using that default repository. Anyway, I'm still working on writing a

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-14 Thread Grzegorz Grzybek
Hello again I've backported 3 "memory" tests from Pax Logging 1.11.x to https://github.com/ops4j/org.ops4j.pax.logging/commits/pax-logging-1.10.x The test (e.g., org.ops4j.pax.logging.it.Log4J2MemoryTest) does this: @Test public void memoryIssues() throws IOException { LOG.info("Starting");

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-13 Thread Monica Ron
Thanks for the additional information. We use pax-logging-log4j2-1.10.5.jar for the backend. I believe I did see in my previous heap analysis investigations that the Log4J2 (pax-logging-log4j2-1.10.5.jar) was holding onto references as you described, but my patch to pax-logging-api at least

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-13 Thread Grzegorz Grzybek
Hello again After little more investigation and careful usage of WeakHashMaps and WeakReferences I managed to create 1M of unique loggers on -Xmx128M that were correctly garbage collected in: - pax-logging-log4j1 - pax-logging-log4j2 (after fixing the problem described in

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-13 Thread Grzegorz Grzybek
Unfortunately I don't think there's much we can do... http://logging.apache.org/log4j/2.x/manual/usage.html#StaticVsNonStatic says: *Once a Logger is created it will not be deleted until the LoggerContext it > is associated with is deleted. Typically, this will only happen when the > application

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-13 Thread Grzegorz Grzybek
I've created https://ops4j1.jira.com/browse/PAXLOGGING-311 and I'm checking it. But simple switching org.ops4j.pax.logging.OSGIPaxLoggingManager#m_loggers to WeakHashMap gave me OOME where the problem was not the order of key-value in the map (TrackingLoggers were correctly disposed, as well as

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-13 Thread Monica Ron
I'm glad you can see what I saw. :) I attached my patch to this post. I first downloaded the 1.10.x branch, and made changes. The patch is the output from 'git diff'. To build what I have using this patch, you can do the following: git init git remote add origin

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-13 Thread Grzegorz Grzybek
Hello I did simple test: @Test public void memoryIssues() throws IOException { for (int i = 0; i < 1_000_000; i++) { new MyClass().run(); } LOG.info("Done"); } private static class MyClass { private Logger nonStaticLogger = LoggerFactory.getLogger(

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-03-11 Thread Grzegorz Grzybek
Hello Great analysis - as always. I'll have a look very soon! regards Grzegorz Grzybek śr., 11 mar 2020 o 16:39 Monica Ron napisał(a): > Hi. I know it's been a while since this was last sent. The change in order > of the generic parameters of the WeakHashMap definitely caused a change in >

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-07 Thread Grzegorz Grzybek
Hello sob., 4 sty 2020 o 02:58 Monica Ron napisał(a): > The new code works for me. Once we deploy our wars, we don't generally > re-deploy until we have a new release, and we usually shutdown the > Glassfish/Payara domain to do that deployment. So, shutting down the JVM > obviously clears all

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-03 Thread Monica Ron
The new code works for me. Once we deploy our wars, we don't generally re-deploy until we have a new release, and we usually shutdown the Glassfish/Payara domain to do that deployment. So, shutting down the JVM obviously clears all memory. I'm not really worried (I think our code should be

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-03 Thread Monica Ron
You're welcome. And maybe if we had kept our code and dependencies up-to-date, the problem would have been noted 4 years ago when the "adding generics" change was first made. ;) Monica On Friday, January 3, 2020 at 10:50:46 AM UTC-5, Grzegorz Grzybek wrote: > > Hello > > I'm glad it worked! >

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-03 Thread Grzegorz Grzybek
Hello I'm glad it worked! *Thank you very much. I spent many hours trying to figure out what was > wrong with my updated POM files and Payara5 deployment before I finally > realized that the problem was with Pax Logging, not with my own code. I am > glad you were able to fix this and make a new

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-03 Thread Monica Ron
I downloaded the pax-logging-api-1.10.5.jar and pax-logging-log4j2-1.10.5.jar from Maven Central, and deployed them in my Payara glassfish/modules/autostart directory. Now when I start Payara with the wars already deployed, it is properly connecting to the pax-logging, and is respecting my

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-03 Thread Grzegorz Grzybek
Hello Monica I've fixed https://ops4j1.jira.com/browse/PAXLOGGING-307 and while pax-logging 1.11.x and 2.0.x have proper tests, there are no such tests in 1.10.x. And also 1.10.x is not the version I was refactoring. So - may I ask you kindly to check

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-02 Thread Grzegorz Grzybek
Just checked new integration tests for 1.11.5-SNAPSHOT and 2.0.0-SNAPSHOT - all is fine. So I'm backporting this change to pax-logging 1.10.x (without tests...) regards Grzegorz Grzybek czw., 2 sty 2020 o 17:42 Monica Ron napisał(a): > I am glad you were able to reproduce the issue and see

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-02 Thread Monica Ron
I am glad you were able to reproduce the issue and see what I meant. Yes, please backport the fix to 1.10.x. I tried the fix for PAXLOGGING-306 for getting the pax-logging-log4j2 in the 1.10.x branch to print stack traces, and it worked--my stack traces were printed correctly. So, if this

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-02 Thread Grzegorz Grzybek
Hello Thanks for describing the problem in such details! I reproduced the problem and indeed - simple: Logger log1a = LoggerFactory.getLogger(this.getClass()); Logger log1b = LoggerFactory.getLogger(this.getClass()); (getting same logger twice), when pax-logging-api is not yet started gives me

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2020-01-02 Thread Grzegorz Grzybek
Hello I created https://ops4j1.jira.com/browse/PAXLOGGING-307 to track this issue. regards Grzegorz Grzybek pon., 9 gru 2019 o 22:35 Monica Ron napisał(a): > Thanks. If you do change the code to fix my problem (e.g., swap order of > the generic parameters, or whatever other way you fix it), I

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2019-12-09 Thread Monica Ron
Thanks. If you do change the code to fix my problem (e.g., swap order of the generic parameters, or whatever other way you fix it), I hope you can release a 1.10.x as well as fixing it on the newer 1.11.x, since I can't use 1.11.x yet. I can't even use 1.10.4, as I'm having trouble with a

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2019-12-05 Thread Grzegorz Grzybek
Hello Thank you for this analysis - you are correct. The goal of removing map-per-logging facade was to unify logging behavior and allowing two bundles to use two different loggers with the same name (though now I think the problem was caused by this generification you've mentioned). There's

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2019-12-05 Thread Monica Ron
I got the tests to run, but I am still working on modifying them to illustrate my problem. It is clear to me from studying the pax logging code and observing its behavior that having the m_loggers maps (whether per logging API or as a single global map) with key=name and value=logger is wrong,

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2019-12-05 Thread Grzegorz Grzybek
Hello I'll run into the same issue I saw with the actual 1.10.4. When a second > logger is registered in that global map with a name that already exists, > the first logger will be lost > This was a case with previous (than 1.11.x) versions too and there was respective PAXLOGGING issue for this:

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2019-12-04 Thread Monica Ron
Thanks. I will write a bug in PAXLOGGING soon. Version 1.11.3 doesn't run on Payara 5.192 (different OSGi version, maybe?). Version 1.10.4 runs, but has the same issue I reported. I downloaded 1.10.4 and swapped the order of the generic parameters to match the original code (i.e., I made

Re: Pax Logging loses track of loggers because of change made when you added generics in December 2015

2019-12-04 Thread Grzegorz Grzybek
Hello I can't speak for this particular commit. I can only try suggesting 1.11.3 version where I've done major refactoring. See https://ops4j1.jira.com/browse/PAXLOGGING-252 for the issue and for new and improved (IMHO) documentation: