Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove process_messages_from_server from MiqWorker #19788

Merged
merged 1 commit into from
Jan 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions app/models/miq_worker/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,6 @@ 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
Expand All @@ -298,15 +296,6 @@ 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may still need this call.

This is what adds the worker info to the server hash for fetching queue messages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that live in the queue_worker then? I don't think non-queue workers need that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's part of what it does. This also ensures that the worker is present in the server's worker's cache. It's not all that straight forward unfortunately, but now that the messages bit is gone we can unravel it in a follow-up, but for this first pass I think we should probably just keep this around.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that means that run_single_worker will still fail if the miq_server isn't running (aka testing out a single worker) can we try to handle that case also?

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
Expand Down