提交 56b360d6 编写于 作者: J Jesse Glick

[JENKINS-19976] Touch-ups to PR #1054.

上级 df8df45c
......@@ -63,6 +63,9 @@ Upcoming changes</a>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22262">issue 22262</a>)
<li class=bug>
<code>identity.key</code>, used to secure some communications with Jenkins, now stored encrypted with the master key.
<li class=bug>
When dynamically loading a plugin which another loaded plugin already had an optional dependency on, class loading errors could result before restart.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19976">issue 19976</a>)
<li class=bug>
Memory leaks in the old data monitor.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19544">issue 19544</a>)
......
......@@ -377,15 +377,6 @@ public class ClassicPluginStrategy implements PluginStrategy {
plugin.getPlugin().start();
}
/**
* Called when a plugin is deployed, and there is a plugin optionally depending on that plugin.
* The class loader of the existing depending plugin should be updated
* to load classes from the newly deployed plugin.
*
* @param depender the plugin to update its class loader
* @param dependee
* @see hudson.PluginStrategy#updateDependency(hudson.PluginWrapper, hudson.PluginWrapper)
*/
@Override
public void updateDependency(PluginWrapper depender, PluginWrapper dependee) {
DependencyClassLoader classLoader = findAncestorDependencyClassLoader(depender.classLoader);
......
......@@ -464,7 +464,11 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
if (d.shortName.equals(p.getShortName())) {
// this plugin depends on the newly loaded one!
// recalculate dependencies!
getPluginStrategy().updateDependency(depender, p);
try {
getPluginStrategy().updateDependency(depender, p);
} catch (AbstractMethodError x) {
LOGGER.log(WARNING, "{0} does not yet implement updateDependency", getPluginStrategy().getClass());
}
break;
}
}
......
......@@ -79,10 +79,12 @@ public interface PluginStrategy extends ExtensionPoint {
<T> List<ExtensionComponent<T>> findComponents(Class<T> type, Hudson hudson);
/**
* Called when a plugin that is depended by another plugin is newly deployed.
*
* Called when a plugin is installed, but there was already a plugin installed which optionally depended on that plugin.
* The class loader of the existing depending plugin should be updated
* to load classes from the newly installed plugin.
* @param depender plugin depending on dependee.
* @param dependee newly loaded plugin.
* @since 1.557
*/
void updateDependency(PluginWrapper depender, PluginWrapper dependee);
}
......@@ -33,13 +33,6 @@ import hudson.model.UpdateSite;
import hudson.scm.SubversionSCM;
import hudson.util.FormValidation;
import hudson.util.PersistedList;
import org.apache.commons.io.FileUtils;
import org.apache.tools.ant.filters.StringInputStream;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.Url;
import org.jvnet.hudson.test.recipes.WithPlugin;
import org.jvnet.hudson.test.recipes.WithPluginManager;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
......@@ -47,6 +40,13 @@ import java.net.URLClassLoader;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Future;
import org.apache.commons.io.FileUtils;
import org.apache.tools.ant.filters.StringInputStream;
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.Url;
import org.jvnet.hudson.test.recipes.WithPlugin;
import org.jvnet.hudson.test.recipes.WithPluginManager;
/**
* @author Kohsuke Kawaguchi
......@@ -310,6 +310,7 @@ public class PluginManagerTest extends HudsonTestCase {
*
* @throws Exception
*/
@Bug(19976)
public void testInstallDependedPluginWithoutRestart() throws Exception {
// Load depender.
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册