-
Notifications
You must be signed in to change notification settings - Fork 900
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
Only register queue workers using drb for dequeue #19829
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,8 +288,6 @@ def heartbeat | |
_log.info("#{log_prefix} Synchronizing configuration complete...") | ||
end | ||
|
||
register_worker_with_worker_monitor unless MiqEnvironment::Command.is_podified? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yay, that |
||
|
||
@last_hb = now | ||
do_heartbeat_work | ||
rescue SystemExit, SignalException | ||
|
@@ -298,12 +296,6 @@ def heartbeat | |
do_exit("Error heartbeating because #{err.class.name}: #{err.message}\n#{err.backtrace.join('\n')}", 1) | ||
end | ||
|
||
def register_worker_with_worker_monitor | ||
worker_monitor_drb.register_worker(@worker.pid, @worker.class.name, @worker.queue_name) | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there something else in this block before? How would DRb::DRbError be raised? We're not doing anything with drb, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see, we used to call
worker_monitor_drb.register_worker
which could raise that exception...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so in this case I just need some call to the drb object to raise to tell if it's available or not. I used a
respond_to?
here because that proxies over to the server side without actually doing anything.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. I don't think the begin/rescue is needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(it's needed in the method above that calls
register_worker
on the drb object)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very much needed I think.
respond_to?
is proxied to the remote drb object so it will raise rather than return false if the drb server is inaccessible.I would love a way to tell if the drb server is up that didn't rely on exception handling, do you know of something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agrare do you know if there's anything like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. I forgot the drb object was proxied and could raise here. Oh DRb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I'm aware of, in
miq_fault_tolerant_vim
which wrapsMiqVim
to deal with DRb "issues" we just catchDRb::DRbConnError
and retry if the broker is on a new port