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

rapu: catch aiohttp.ClientError with a 503 response status #896

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

nosahama
Copy link
Contributor

@nosahama nosahama commented Jun 7, 2024

About this change - What it does

This catches aiohttp.ClientError and returns HTTPStatus<503> rather than HTTPStatus<500>.
We also catch the base aiohttp.ClientError rather than just aiohttp.ClientConnectorError, as for us, most client errors will also be TCP connection related, rather than actual invalid request data, etc and we include the exception information with the logged message, this can further aid debugging.

References: HH-3866

Why this way

Reflects properly the behaviour of the server via the response status.

@nosahama nosahama requested review from a team as code owners June 7, 2024 11:59
Copy link
Contributor

@eliax1996 eliax1996 left a comment

Choose a reason for hiding this comment

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

Just asking to update the description of the pr :) the change by itself its an improvement.
Giving @jjaakola-aiven the possibility to reply on his raised point even if to me it sounds reasonable to catch both exceptions in the same scope, maybe would be useful to highlight a case where the behaviour its different and the management should be done in a different way

Copy link
Contributor

@eliax1996 eliax1996 left a comment

Choose a reason for hiding this comment

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

lgtm

@eliax1996 eliax1996 merged commit 4ccf6c1 into main Jun 10, 2024
8 checks passed
@eliax1996 eliax1996 deleted the nosahama/rapu-catch-client-aiohttp-errors branch June 10, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants