Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOMEE-4192 ApplicationComposers do not clear GC references on release #1030

Merged
merged 4 commits into from Apr 4, 2023

Conversation

G-Ork
Copy link
Contributor

@G-Ork G-Ork commented Mar 19, 2023

No description provided.

@G-Ork
Copy link
Contributor Author

G-Ork commented Mar 24, 2023

Thank you all...

@rzo1
Copy link
Contributor

rzo1 commented Mar 24, 2023

Thanks for the PR @G-Ork !

Copy link
Contributor

@rzo1 rzo1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we have some regressions with this change:

org.apache.openejb.junit.ContainerAndApplicationRulesTest.test
org.apache.openejb.junit.ContainerApplicationRuleTest.run

specifically:

java.lang.NullPointerException
	at org.apache.openejb.testing.ApplicationComposers.after(ApplicationComposers.java:1112)
	at org.apache.openejb.junit.ContainerRule$1.evaluate(ContainerRule.java:47)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:377)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:284)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:248)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:167)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581

Would you mind having a look? I guess, that it would be sufficient to add null checks.

CI:

@G-Ork
Copy link
Contributor Author

G-Ork commented Mar 27, 2023 via email

@rzo1
Copy link
Contributor

rzo1 commented Mar 27, 2023

Hi I will look. Give me some days to overcome corona. Richard Zowalla @.> schrieb am Mo., 27. März 2023, 12:56:

@.
* requested changes on this pull request. Looks like we have some regressions with this change: org.apache.openejb.junit.ContainerAndApplicationRulesTest.test org.apache.openejb.junit.ContainerApplicationRuleTest.run specifically: java.lang.NullPointerException at org.apache.openejb.testing.ApplicationComposers.after(ApplicationComposers.java:1112) at org.apache.openejb.junit.ContainerRule$1.evaluate(ContainerRule.java:47) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:377) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:284) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:248) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:167) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169) at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581 Would you mind having a look? — Reply to this email directly, view it on GitHub <#1030 (review)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZCNF6D3SIZNBW3BRWZ5QDW6FW7FANCNFSM6AAAAAAWACYBRY . You are receiving this because you were mentioned.Message ID: @.***>

Sure. Get well soon (also had it last week, therefore my late response)

Copy link
Contributor Author

@G-Ork G-Ork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the code to integrate better with older junit testrules:

  • Added an null-check to prevent NPE
  • move the reference resets to stopApplication()

this should also free references in older junit tests. The Fix is necessary because in this case two composers are active. One do not have an appContext initialized. The one with an context do not call after() just stopApplication().

@G-Ork G-Ork requested a review from rzo1 March 29, 2023 15:08
Copy link
Contributor

@rzo1 rzo1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builds (9,8) looking good with this change. Thanks for the PR @G-Ork

@rzo1 rzo1 merged commit 9d9991b into apache:main Apr 4, 2023
1 check passed
@rzo1
Copy link
Contributor

rzo1 commented Apr 4, 2023

Thanks @G-Ork

cesarhernandezgt pushed a commit to cesarhernandezgt/tomee that referenced this pull request May 24, 2023
…apache#1030)

* TOMEE-4192 ApplicationComposers do not clear GC references on release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants