From 364d41d1c320880a768feb941e5211bbcb64054b Mon Sep 17 00:00:00 2001 From: candysmurf <77.ears@gmail.com> Date: Fri, 12 Feb 2016 12:38:01 -0800 Subject: [PATCH] added warn log for restarting a plugin --- control/control_test.go | 4 ++-- control/runner.go | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/control/control_test.go b/control/control_test.go index 457dd852a..9d12595bc 100644 --- a/control/control_test.go +++ b/control/control_test.go @@ -1150,8 +1150,8 @@ func TestFailedPlugin(t *testing.T) { } <-lpe.done eventMap[lpe.plugin.EventNamespace]++ - So(eventMap[control_event.AvailablePluginDead], ShouldEqual, 4) - So(eventMap[control_event.AvailablePluginRestarted], ShouldEqual, 3) + So(eventMap[control_event.AvailablePluginDead], ShouldEqual, MaxPluginRestartCount+1) + So(eventMap[control_event.AvailablePluginRestarted], ShouldEqual, MaxPluginRestartCount) So(eventMap[control_event.PluginRestartsExceeded], ShouldEqual, 1) So(len(pool.Plugins()), ShouldEqual, 0) So(pool.RestartCount(), ShouldEqual, MaxPluginRestartCount) diff --git a/control/runner.go b/control/runner.go index d30f01a88..c5f9364b1 100644 --- a/control/runner.go +++ b/control/runner.go @@ -268,6 +268,14 @@ func (r *runner) HandleGomitEvent(e gomit.Event) { return } pool.IncRestartCount() + + runnerLog.WithFields(log.Fields{ + "_block": "handle-events", + "event": v.Name, + "aplugin": v.Version, + "restart_count": pool.RestartCount(), + }).Warning("plugin restarted") + r.emitter.Emit(&control_event.RestartedAvailablePluginEvent{ Id: v.Id, Name: v.Name,