diff --git a/app/models/miq_worker/runner.rb b/app/models/miq_worker/runner.rb index 7de832b024f6..70fb3542295d 100644 --- a/app/models/miq_worker/runner.rb +++ b/app/models/miq_worker/runner.rb @@ -288,6 +288,8 @@ def heartbeat _log.info("#{log_prefix} Synchronizing configuration complete...") end + process_messages_from_server unless MiqEnvironment::Command.is_podified? + @last_hb = now do_heartbeat_work rescue SystemExit, SignalException @@ -296,6 +298,15 @@ def heartbeat do_exit("Error heartbeating because #{err.class.name}: #{err.message}\n#{err.backtrace.join('\n')}", 1) end + def process_messages_from_server + worker_monitor_drb.register_worker(@worker.pid, @worker.class.name, @worker.queue_name) + worker_monitor_drb.worker_get_messages(@worker.pid).each do |msg, *args| + process_message(msg, *args) + end + rescue DRb::DRbError => err + do_exit("Error processing messages from MiqServer because #{err.class.name}: #{err.message}", 1) + end + def heartbeat_to_file(timeout = nil) # Disable heartbeat check. Useful if a worker is running in isolation # without the oversight of MiqServer::WorkerManagement