Fixed RD-15322: Report user-visible errors to caller instead of retrying #20
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.
This goes with raw-labs/multicorn-das#15.
In this changeset, we use StatusCode
INVALID_ARGUMENT
to flag an error that should be advertised to the user. If a call fails with that error, in multicorn we propagate the exception. That patch goes with a symmetric patch in multicorn.NOT_FOUND
.try/catch
that eventually returns anINVALID_ARGUMENT
error. This fails if anINSERT
,UPDATE
is given a forbidden value (e.g. a string that is too large), if the operation isn't supported by the backend. AlsoSELECT
can fail as certain backends wouldn't offer read access to a table.These code paths were tested using:
events
that does support all operations but fails if provided dates (qualifiers, values) are before year 2000,Then all these queries are run with a DAS server up, or down then restarted during the retries.
Execute
retries if needed and fails because the filter is rejected.
retries if needed and runs successfully.
retries if needed and fails because the table isn't found. (This can happen if restarting a DAS and it lost a table.)
Insert
retries if needed and fails because the table doesn't support
INSERT
.retries if needed and fails because the date is wrong.
retries if needed and runs successfully.
Update
retries if needed and fails because the table doesn't support
UPDATE
.retries if needed and fails because the date is wrong.
retries if needed and runs successfully.
Delete
retries if needed and fails because the table doesn't support
DELETE
.retries if needed and fails because the date is wrong.
retries if needed and runs successfully.