From aab6b9cc8bbc0d21f9b48da7a17887f5c0d30f50 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Thu, 13 Aug 2020 08:43:17 -0400 Subject: [PATCH] Don't allow kafka exceptions to cause EmsEvent.add_queue to fail If there are issues publishing events to kafka we shouldn't allow them to cause the main MiqQueue EmsEvent.add to fail --- app/models/ems_event.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/ems_event.rb b/app/models/ems_event.rb index 24d9e6f301d..750fe961055 100644 --- a/app/models/ems_event.rb +++ b/app/models/ems_event.rb @@ -274,6 +274,9 @@ def self.publish_event(ems_id, event) :event => event[:event_type], :payload => event ) + rescue => err + _log.warn("Failed to publish event [#{ems_id}] [#{event[:event_type]}]: #{err}") + _log.log_backtrace(err) end private_class_method :publish_event