Fix DropWizard timer cleanup upon plugin reload

PluginMetricMaker rely on the definition of its Lifecycle
listener on the root injector to clean-up the timer metrics upon 
reload of a plugin. We need to register the listeners from the root
injector as well to make sure to invoke the cleanup when the plugin
is unloaded or reloaded.

Without this change, the replication plugin is broken after reload
as discussed at [1].

[1] https://groups.google.com/forum/#!topic/repo-discuss/c3lLsTgFZdI

Change-Id: I6e468bb7a01ec23983c0f1d8ad80058ec0fd8b01
This commit is contained in:
Luca Milanesio
2015-12-31 16:42:18 +00:00
parent 26e073da4d
commit 286bfd820f

View File

@@ -179,6 +179,7 @@ public class ServerPlugin extends Plugin {
private void startPlugin(PluginGuiceEnvironment env) throws Exception {
Injector root = newRootInjector(env);
serverManager = new LifecycleManager();
serverManager.add(root);
AutoRegisterModules auto = null;
if (sysModule == null && sshModule == null && httpModule == null) {