Don't go through init sequence twice

As a part of PR 1847, 3b5424e507 introduced a second invocation to
executeReactor. This is causing a problem in that it exectes
InitMilestone progression twice. If you are looking at
Jenkins.getInitLevel() it will go through STARTED ... COMPLETED once,
then it goes back to STARTED and then go to COMPLETED again.

And this code looks bit odd anyway. Why execute a whole reactor
just to make one method invocation? But I didn't see any discussion of
this in PR 1847.

This change fixes this oddity by making this a part of the main
(and sole) initialization reactor session. It's not clear what
milestone should be the pre-requisite, but given that it's only looking
at dependency chain, PLUGINS_PREPARED should be adequate.
This commit is contained in:
Kohsuke Kawaguchi committed 2016-03-26 13:10:25 -07:00
1 parent 0ebf47bd34
commit 4b8d30a100
2 files changed
+8 -16

No files matched your search

@@ -443,6 +443,14 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
session.addAll(g.discoverTasks(session));
}
});
// All plugins are loaded. Now we can figure out who depends on who.
requires(PLUGINS_PREPARED).attains(COMPLETED).add("Resolving Dependant Plugins Graph", new Executable() {
@Override
public void run(Reactor reactor) throws Exception {
resolveDependantPlugins();
}
});
}});
}