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

Fix #1383: map most recognized SERVER_ errors to 504 or 502, leave 500 for unrecognized #1384

Merged
merged 4 commits into from
Sep 3, 2024

Conversation

tatu-at-datastax
Copy link
Contributor

What this PR does:

Maps most former 500 http failures to 504 or 502, to indicate these are recognized failures with backend DB; 500 remains for unknown/unrecognized exceptions

Which issue(s) this PR fixes:
Fixes #1383

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@tatu-at-datastax tatu-at-datastax self-assigned this Aug 30, 2024
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner August 30, 2024 20:30
Comment on lines 92 to 93
.toApiException("(DriverException/ClosedConnectionException) %s", message)
.getCommandResultError(Response.Status.GATEWAY_TIMEOUT);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why here is GATEWAY_TIMEOUT not BAD_GATEWAY?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me double-check; you are right seems odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hazel-Datastax yes, you are right: should be BAD_GATEWAY -- changing. Thank you!

Copy link
Contributor

@maheshrajamani maheshrajamani left a comment

Choose a reason for hiding this comment

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

LGTM

@tatu-at-datastax tatu-at-datastax merged commit ee4c929 into main Sep 3, 2024
3 checks passed
@tatu-at-datastax tatu-at-datastax deleted the tatu/1383-http-500-to-504 branch September 3, 2024 20:08
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Exceptions from Database (via CQL Driver) incorrectly mapped to HTTP 500, should be 504 (or 502)
4 participants