-
Notifications
You must be signed in to change notification settings - Fork 899
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
Rework Kafka health check #23020
Rework Kafka health check #23020
Conversation
We will need to bump manageiq-messaging once ManageIQ/manageiq-messaging#88 is merged and a new version is released |
d95e9fb
to
45546fb
Compare
app/models/miq_server.rb
Outdated
# Fail health check if list of topics can't be retrieved | ||
broker.topics |
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 Should we log on success here? The push/pop approach had logging baked in by the messaging client
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.
I think we're okay to just log on failure
app/models/miq_server.rb
Outdated
rescue => err | ||
_log.error("Messaging health check failed: #{err}") | ||
shutdown_and_exit(1) | ||
ensure | ||
broker.close |
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.
You need to handle the case where broker is nil here because ensure will still trigger on the return up here https://github.com/ManageIQ/manageiq/pull/23020/files#diff-0c71d22135646ed908fa6a66bec47aa6024935e7d9ed66e4a99c64f9355b3307R628
The other option is to have an explicit begin/rescue/ensure like
def messaging_health_check
broker =
return if broker.nil?
begin
...
rescue => err
...
ensure
broker.close
end
end
@nasark manageiq-messaging v1.4.2 released with ManageIQ/manageiq-messaging#88 |
c320447
to
4f4a4c4
Compare
4f4a4c4
to
8229620
Compare
Checked commits nasark/manageiq@38debb3~...8229620 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
Backported to
|
…heck Rework Kafka health check (cherry picked from commit 6351fd6)
Depends on:
@miq-bot assign @agrare
@miq-bot add_reviewer @agrare
@miq-bot add_labels enhancement, bug