Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
added warn log for restarting a plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
candysmurf authored and jcooklin committed Feb 18, 2016
1 parent dc59424 commit 364d41d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions control/control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions control/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 364d41d

Please sign in to comment.