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

Commit

Permalink
Changed aplugin to plugin_name:
Browse files Browse the repository at this point in the history
- Simplifies error messages
- Consistent with other error and warning messages
  • Loading branch information
kjlyon committed Oct 20, 2016
1 parent e72f01e commit 1cb9bcf
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions control/available_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,26 +217,26 @@ func (a *availablePlugin) LastHit() time.Time {
// Stop halts a running availablePlugin
func (a *availablePlugin) Stop(r string) error {
log.WithFields(log.Fields{
"_module": "control-aplugin",
"block": "stop",
"aplugin": a,
"_module": "control-aplugin",
"block": "stop",
"plugin_name": a,
}).Info("stopping available plugin")
return a.client.Kill(r)
}

// Kill assumes aplugin is not able to here a Kill RPC call
func (a *availablePlugin) Kill(r string) error {
log.WithFields(log.Fields{
"_module": "control-aplugin",
"block": "kill",
"aplugin": a,
"_module": "control-aplugin",
"block": "kill",
"plugin_name": a,
}).Info("hard killing available plugin")
if a.fromPackage {
log.WithFields(log.Fields{
"_module": "control-aplugin",
"block": "kill",
"aplugin": a,
"pluginPath": path.Join(a.execPath, a.exec),
"_module": "control-aplugin",
"block": "kill",
"plugin_name": a,
"pluginPath": path.Join(a.execPath, a.exec),
}).Debug("deleting available plugin path")
os.RemoveAll(filepath.Dir(a.execPath))
}
Expand All @@ -255,9 +255,9 @@ func (a *availablePlugin) CheckHealth() {
if a.failedHealthChecks > 0 {
// only log on first ok health check
log.WithFields(log.Fields{
"_module": "control-aplugin",
"block": "check-health",
"aplugin": a,
"_module": "control-aplugin",
"block": "check-health",
"plugin_name": a,
}).Debug("health is ok")
}
a.failedHealthChecks = 0
Expand All @@ -273,16 +273,16 @@ func (a *availablePlugin) CheckHealth() {
// and a HealthCheckFailedEvent
func (a *availablePlugin) healthCheckFailed() {
log.WithFields(log.Fields{
"_module": "control-aplugin",
"block": "check-health",
"aplugin": a,
"_module": "control-aplugin",
"block": "check-health",
"plugin_name": a,
}).Warning("heartbeat missed")
a.failedHealthChecks++
if a.failedHealthChecks >= DefaultHealthCheckFailureLimit {
log.WithFields(log.Fields{
"_module": "control-aplugin",
"block": "check-health",
"aplugin": a,
"_module": "control-aplugin",
"block": "check-health",
"plugin_name": a,
}).Warning("heartbeat failed")
pde := &control_event.DeadAvailablePluginEvent{
Name: a.name,
Expand Down

0 comments on commit 1cb9bcf

Please sign in to comment.