-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Jetty 9.4.x 5859 classloader leak queuedthreadpool #5894
Jetty 9.4.x 5859 classloader leak queuedthreadpool #5894
Conversation
Signed-off-by: Jan Bartel <janb@webtide.com>
Signed-off-by: Jan Bartel <janb@webtide.com>
jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java
Outdated
Show resolved
Hide resolved
jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java
Show resolved
Hide resolved
Signed-off-by: Jan Bartel <janb@webtide.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…59-classloader-leak-queuedthreadpool
Signed-off-by: Jan Bartel <janb@webtide.com>
@gregw / @sbordet reviewing the OP's info from issue #5859, it seems to me that the QueuedThreadPool threads are also vulnerable to the problem he reported in the same issue regarding the ShutdownThread: namely the inheritance by a new Thread() of the calling AccessContext, containing a reference to the ProtectionDomain which has a reference to the current contextClassloader. So the fix he suggested for ShutdownThread I've also applied to the QueuedThreadPool, and also rolled the fix for the ShutdownThread into this PR instead of opening a separate PR for it. Please (re)review. |
Signed-off-by: Jan Bartel <janb@webtide.com>
Signed-off-by: Jan Bartel <janb@webtide.com>
Signed-off-by: Jan Bartel <janb@webtide.com>
Signed-off-by: Jan Bartel <janb@webtide.com>
…59-classloader-leak-queuedthreadpool
…59-classloader-leak-queuedthreadpool
Signed-off-by: Jan Bartel <janb@webtide.com>
Jetty version has been upgraded in this commit : gravitee-io/gravitee-bom@6eb8566 It introduced mutliple regressions in APIM. Since 9.4.37, Jettys threads classloaders have been refactored to fix a leak (see jetty/jetty.project#5894). After this fix, threads classpath is override with local classpath, so it does not contain gravitee context class loader nomore (see https://github.com/eclipse/jetty.project/pull/5894/files#diff-6f0181889aa765771dd358e58fc07e2a7d7bfa44c451359e34e3eea574a5a79cR696). Created a JettyQueuedThreadPool, to override Jetty's default QueuedThreadPool and give the gravitee context class loader to created threads.
Jetty version has been upgraded in this commit : gravitee-io/gravitee-bom@6eb8566 It introduced mutliple regressions in APIM. Since 9.4.37, Jettys threads classloaders have been refactored to fix a leak (see jetty/jetty.project#5894). After this fix, threads classpath is override with local classpath, so it does not contain gravitee context class loader nomore (see https://github.com/eclipse/jetty.project/pull/5894/files#diff-6f0181889aa765771dd358e58fc07e2a7d7bfa44c451359e34e3eea574a5a79cR696). Created a JettyQueuedThreadPool, to override Jetty's default QueuedThreadPool and give the gravitee context class loader to created threads.
Jetty version has been upgraded in this commit : gravitee-io/gravitee-bom@6eb8566 It introduced mutliple regressions in APIM. Since 9.4.37, Jettys threads classloaders have been refactored to fix a leak (see jetty/jetty.project#5894). After this fix, threads classpath is override with local classpath, so it does not contain gravitee context class loader nomore (see https://github.com/eclipse/jetty.project/pull/5894/files#diff-6f0181889aa765771dd358e58fc07e2a7d7bfa44c451359e34e3eea574a5a79cR696). Created a JettyQueuedThreadPool, to override Jetty's default QueuedThreadPool and give the gravitee context class loader to created threads.
Jetty version has been upgraded in this commit : gravitee-io/gravitee-bom@6eb8566 It introduced mutliple regressions in APIM. Since 9.4.37, Jettys threads classloaders have been refactored to fix a leak (see jetty/jetty.project#5894). After this fix, threads classpath is override with local classpath, so it does not contain gravitee context class loader nomore (see https://github.com/eclipse/jetty.project/pull/5894/files#diff-6f0181889aa765771dd358e58fc07e2a7d7bfa44c451359e34e3eea574a5a79cR696). Created a JettyQueuedThreadPool, to override Jetty's default QueuedThreadPool and give the gravitee context class loader to created threads.
Jetty version has been upgraded in this commit : gravitee-io/gravitee-bom@6eb8566 It introduced mutliple regressions in APIM. Since 9.4.37, Jettys threads classloaders have been refactored to fix a leak (see jetty/jetty.project#5894). After this fix, threads classpath is override with local classpath, so it does not contain gravitee context class loader nomore (see https://github.com/eclipse/jetty.project/pull/5894/files#diff-6f0181889aa765771dd358e58fc07e2a7d7bfa44c451359e34e3eea574a5a79cR696). Created a JettyQueuedThreadPool, to override Jetty's default QueuedThreadPool and give the gravitee context class loader to created threads.
See #5859
Ensure that QueuedThreadPool threads have their initial context classloader explicitly set, rather than defaulting to whatever the calling thread is using.