Move ReplicationQueue and associated bindings to ReplicationModule
During the refactoring in I8003ec6c827f the ReplicationQueue and its
associated bindings were moved to the ReplicationConfigModule for
allowing the users of the replication APIs to be able to have the
full bindings of all the internal replication plugin mechanisms.
However, the change was reverted in I461cd1bef because of the
breakages generated and later a new approch has been introduced
with I349461e29d where the APIs are exposed via DynamicItem<>
and the caller isn't required anymore to have the full Guice
bindings to re-create the replication objects.
As a result, the bindings of the replication plugin internals
remained in the ReplicationConfigModule with nasty consequences
of other plugins (e.g. pull-replication) to inadvertently generate
just-in-time bindings of the replication plugin classes.
When using the pull-replication and replication plugins together
the just-in-time bindings would then eventually conflict
with the explicit bindings done in the replication plugin.
Example:
[2024-06-27T22:23:19.471+01:00] [main] WARN com.google.gerrit.server.plugins.PluginLoader : Cannot load plugin replication
com.google.inject.CreationException: Unable to create injector, see the following errors:
1) [Guice/JitBindingAlreadySet]: A just-in-time binding to DynamicSet<ReplicationStateListener> was already configured on a parent injector.
at DynamicSet.setOf(DynamicSet.java:88)
1 error
DynamicSet: "com.google.gerrit.extensions.registration.DynamicSet"
ReplicationStateListener: "com.googlesource.gerrit.plugins.replication.ReplicationStateListener"
By moving back the replication plugin internal classes
bindings into its proper ReplicationModule the problem is fully
resolved and there aren't just-in-time bindings created
implicitly anymore.
Change-Id: I2bf9dab0d2555310b4d1b0c66528b2aaa2cc5106
2 files changed