Don't log event error on driver shutdown

This commit is contained in:
Alex Dadgar 2018-12-19 15:39:30 -08:00
parent 39542b4cf0
commit c3f05f2476

View file

@ -447,6 +447,11 @@ func (i *instanceManager) handleEvents() {
// handleEvent looks up the event handler(s) for the event and runs them
func (i *instanceManager) handleEvent(ev *drivers.TaskEvent) {
// Do not emit that the plugin is shutdown
if ev.Err != nil && ev.Err == base.ErrPluginShutdown {
return
}
if handler := i.eventHandlerFactory(ev.AllocID, ev.TaskName); handler != nil {
i.logger.Trace("task event received", "event", ev)
handler(ev)