Fixed
Status Update
Comments
lu...@gmail.com <lu...@gmail.com>
lu...@gmail.com <lu...@gmail.com> #2
This is not a replication
plugin problem, but a PluginLoader
issue:
- The replication plugin exposes an
ApiModule
in master - The
ApiModule
is loaded into theapiInjector
of theServerPlugin
- All the plugins with an
ApiModule
andapiInjector
are chained together
Whilst the start()
was fully implemented, the stop()
was not, see below:
protected void stop(PluginGuiceEnvironment env) {
if (serverManager != null) {
RequestContext oldContext = env.enter(this);
try {
serverManager.stop();
} finally {
env.exit(oldContext);
}
serverManager = null;
sysInjector = null;
sshInjector = null;
httpInjector = null;
}
}
There isn't anything that manages the apiInjector
therefore the unloading keeps the injections as-is. When the plugin is reloaded, then boom the injections are duplicated.
I know how to fix it, leave it with me!
ap...@google.com <ap...@google.com> #3
@Saša see an initial fix here:
This formally works, BUT isn't ready yet because in addition to keeping the old interface definition (acceptable IMHO) it also references the old classes, making the new reloaded code unreachable.
It is late now, will resume the efforts tomorrow.
Description
Change in [1] introduced x-plugin dependency; however this looks broken when multiple plugins define an
ApiModule
.Currently on
master
there are at least two plugins that do this; the healthcheck plugin and the replication plugin via a recent change (see [2]). When I create a health check in the pull-replication plugin, that healthcheck is never registered in the dynamic set, and as such the health check is never executed.The exact same code works in 3.9, which is no surprising given the change in [2] exists only on master (ie there are not multiple plugins that expose an
ApiModule
, just the healthcheck plugin).How to reproduce the bug on
master
:pull-replication
healthcheck will not be present in the response.[1]https://gerrit-review.googlesource.com/c/gerrit/+/299472
[2] https://gerrit-review.googlesource.com/c/plugins/replication/+/400797
[3] https://gerrit.googlesource.com/plugins/healthcheck/+/refs/heads/master/src/main/resources/Documentation/extensions.md