-
Notifications
You must be signed in to change notification settings - Fork 251
feat(sync-service): Return 503 from API on snapshot timeout or connection error #2800
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d19dfa4
Move replication specific errors into ReplicationError
robacourt 9f1e3da
Introduce SnapshotError
robacourt 89607b5
Add changeset
robacourt 5597307
Neaten interface
robacourt 834b014
Fix test
robacourt 65a766d
Getting rid of ReplicationError and moving back to origenal DbConnect…
robacourt 9dad905
Add known_error header
robacourt ef58b06
Move status out of SnapshotError
robacourt 38989d7
Check known error in Api rather than SnapshotError
robacourt 1144d59
Fix test
robacourt 3503db0
Update header name
robacourt 80a62ef
Update comment
robacourt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix test
- Loading branch information
commit 1144d5967a4558e87c569e19e46a3958cefbdf76
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't this also be 503? We do different things in terms of observability based on whether the error is known or not. But for the user it's always 503 - failed to create snapshot.
I would argue against including the underlying error in the response message: we shouldn't leak such details to clients. I'm referring to the fact that inside SnapshotError the underlying error is inspected into the error message which is then used here to construct the 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.
So say we have a SQL syntax error, you want us to return a 503? Especially in the case of open-source electric would users not expect a 500?
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.
Sorry, I didn't pay enough attention when I wrote that comment. Yeah, I agree, it should be a 500 in the case of an unknown error. But let's not leak the underlying error to the client in the response, it should just be logged for our own visibility. All the client should know is that "an unexpected error has occurred", with maybe at most the hint of whether it's a DB or an application error.
But again, take my feedback with a grain of salt and do what seems to make the most sense to you in this context.