payara / Payara

Payara Server is an open source middleware platform that supports reliable and secure deployments of Java EE (Jakarta EE) and MicroProfile applications in any environment: on premise, in the cloud or hybrid.
http://www.payara.fish
Other
879 stars 300 forks source link

Bug Report: Regression results in dangling ContainerBackgroundSessionProcessor threads #6747

Closed lprimak closed 2 months ago

lprimak commented 2 months ago

Brief Summary

Looks like https://github.com/payara/Payara/pull/6637 introduced a regression. ContainerBackgroundSessionProcessor threads aren't getting removed when an application is undeployed.

Looking at the code, I don't see any obvious issues, but thread dumps show that the threads are dangling. This prevents application from unloading and creates more memory leaks, and prevents #6677 from working.

I will try to debug and see what I can find out, and submit a PR if I can. But currently, I can't see any obvious cause of this.

Expected Outcome

ContainerBackgroundSessionProcessor threads exit when application is unloaded

Current Outcome

Dangling ContainerBackgroundSessionProcessor As you can see in the image below, there are more ContainerBackgroundSessionProcessor threads than ContainerBackgroundProcessor threads, which is wrong

336649914-52319230-da10-40fb-9a36-7e6c99cf2a5b

Reproducer

Any WAR application will show this behavior

Operating System

Any

JDK Version

Any

Payara Distribution

Payara Server Full Profile, Payara Server Web Profile

lprimak commented 2 months ago

Good news! I have found the bug (it's pretty trivial) and will issue PR shortly