-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix(cat-gateway): Correct Service Health logic #1974
base: main
Are you sure you want to change the base?
Conversation
…point and middleware
…point and middleware
30a233a
to
3bf2daf
Compare
✅ Test Report | |
// TODO: find a better way to filter URI paths | ||
if !req.uri().path().starts_with("/health") { | ||
if !EventDB::connection_is_ok() { | ||
set_index_db_liveness(false); |
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.
Should it be set_event_db_liveness
?
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.
Thanks for the catch!
…lower first syncs
// Return 204 response if check passed initially. | ||
if index_db_live && event_db_live { | ||
return success_response; | ||
} | ||
|
||
// Otherwise, re-check, and return 204 response if all is good. | ||
if index_db_is_live() && event_db_is_live() { | ||
return success_response; | ||
} |
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.
Why do we need the first check? if index_db_live && event_db_live {
Can we do just if index_db_is_live() && event_db_is_live() {
?
/// Flag to determine if the service has started | ||
static STARTED: AtomicBool = AtomicBool::new(false); | ||
|
||
/// Flag to determine if the service has started. |
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.
/// Flag to determine if the service has started. | |
/// Flag to determine if the index db is lived. |
/// Flag to determine if the service has started. | ||
static LIVE_INDEX_DB: AtomicBool = AtomicBool::new(false); | ||
|
||
/// Flag to determine if the service has started. |
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.
/// Flag to determine if the service has started. | |
/// Flag to determine if the event db is lived. |
Description
Logic is implemented as outlined in #1827.
Related Issue(s)
Closes #1827 .
Description of Changes
Provide a clear and concise description of what the pull request changes.
Breaking Changes
Describe any breaking changes and the impact.
Screenshots
If applicable, add screenshots to help explain your changes.
Related Pull Requests
#1921 , #1919
Please confirm the following checks