Status Update
Comments
sv...@axis.com <sv...@axis.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.
sv...@axis.com <sv...@axis.com> #4
I believe the overall issue here is that, after ApiModule
, which is the lightweight version of the libModule exposing just an API.
The ApiModule
are supposed to be loaded only once and used as base injector for all plugins. When replication became an ApiModule
has lost its ability to be dynamically reloaded.
The best solution would be to introduce a new target in the replication plugin to generate the ApiModule
as standalone jar (e.g. replication-api.jar
) and leave the replication.jar
as a regular plugin.
We can also amend the x-plugin support in future versions of Gerrit to allow reloadable ApiModule
, but that is a much more complex exercise, because it involves the construction of a full dependency graph of the dependencies and reload all the dependent plugins when an ApiModule
is reoaded.
Description
When running tests in parallel on Ubuntu 20.04 (haven't tested other Linux dists) there's a Bazel bug that causes the JVMs for each test to write to the same temp file.
See attached stacktrace.
Related issues:
Issue affects:
The issue does not seem to affect:
This issue is fixed in Bazel 7 (i.e. Gerrit master ):