-
Notifications
You must be signed in to change notification settings - Fork 20
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
[DPE-3895] Handle get patroni health exception #421
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #421 +/- ##
=======================================
Coverage 81.08% 81.08%
=======================================
Files 10 10
Lines 2252 2252
Branches 362 362
=======================================
Hits 1826 1826
Misses 351 351
Partials 75 75 ☔ View full report in Codecov by Sentry. |
@@ -313,7 +313,7 @@ def get_patroni_health(self) -> Dict[str, str]: | |||
timeout=API_REQUEST_TIMEOUT, | |||
) | |||
|
|||
return r.json() | |||
return r.json() |
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.
If the response can't be parsed, retry.
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.
Nice catch!
@@ -313,7 +313,7 @@ def get_patroni_health(self) -> Dict[str, str]: | |||
timeout=API_REQUEST_TIMEOUT, | |||
) | |||
|
|||
return r.json() | |||
return r.json() |
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.
Nice catch!
Try to catch the exception in #419
There are already handlers for RetryErrors, but we do not try to parse the json response within the tenacity attempt. There may be more underlying issues here, since patroni isn't responding with a valid json.