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

[DPE-3895] Handle get patroni health exception #421

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Apr 1, 2024

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.

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.08%. Comparing base (7ec5f9b) to head (10e9bde).

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.
📢 Have feedback on the report? Share it here.

@dragomirp dragomirp marked this pull request as ready for review April 1, 2024 16:16
@@ -313,7 +313,7 @@ def get_patroni_health(self) -> Dict[str, str]:
timeout=API_REQUEST_TIMEOUT,
)

return r.json()
return r.json()
Copy link
Contributor Author

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.

Copy link
Contributor

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()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch!

@dragomirp dragomirp merged commit 10a6cc0 into main Apr 2, 2024
49 checks passed
@dragomirp dragomirp deleted the dpe-3895-get-health-fix branch April 2, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants