mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 20:12:14 +00:00
Release detached plugin class loaders on shutdown (#6034)
This commit is contained in:
1 parent
91675c5d44
commit
560136b534
1 file changed
+6
-2
@@ -1327,12 +1327,16 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
/**
|
||||
* Orderly terminates all the plugins.
|
||||
*/
|
||||
public void stop() {
|
||||
public synchronized void stop() {
|
||||
for (PluginWrapper p : activePlugins) {
|
||||
p.stop();
|
||||
}
|
||||
List<PluginWrapper> pluginsCopy = new ArrayList<>(plugins);
|
||||
for (PluginWrapper p : pluginsCopy) {
|
||||
activePlugins.remove(p);
|
||||
plugins.remove(p);
|
||||
p.releaseClassLoader();
|
||||
}
|
||||
activePlugins.clear();
|
||||
// Work around a bug in commons-logging.
|
||||
// See http://www.szegedi.org/articles/memleak.html
|
||||
LogFactory.release(uberClassLoader);
|
||||
|
||||
Reference in new issue
Block a user