Updating state management example to include etag mismatch exception handling#458
Merged
artursouza merged 3 commits intodapr:masterfrom Jan 27, 2021
Merged
Updating state management example to include etag mismatch exception handling#458artursouza merged 3 commits intodapr:masterfrom
artursouza merged 3 commits intodapr:masterfrom
Conversation
…scenario. Dapr runtime grpc exception handling was recently updated to return aborted error code on etage mismatch for mutations, the example is updated to reflect that the runtime updates will be propagated through the java sdk.
mukundansundar
previously approved these changes
Jan 27, 2021
artursouza
suggested changes
Jan 27, 2021
| // delete state API | ||
| Mono<Void> mono = client.deleteState(STATE_STORE_NAME, FIRST_KEY_NAME); | ||
| try { | ||
| Mono<Void> mono = client.deleteState(STATE_STORE_NAME, FIRST_KEY_NAME, "100", null); |
Contributor
There was a problem hiding this comment.
You can do a block right in the end of this line.
Contributor
Author
There was a problem hiding this comment.
good catch, updated
Codecov Report
@@ Coverage Diff @@
## master #458 +/- ##
=========================================
Coverage 82.92% 82.92%
Complexity 931 931
=========================================
Files 79 79
Lines 2717 2717
Branches 269 269
=========================================
Hits 2253 2253
Misses 331 331
Partials 133 133
Continue to review full report at Codecov.
|
artursouza
approved these changes
Jan 27, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Updating state management example to include etag mismatch exception scenario. Dapr runtime grpc exception handling was recently updated to return aborted error code on etage mismatch for mutations, the example is updated to reflect that the runtime updates will be propagated through the java sdk.
ABORTED: failed deleting state with key myKey: possible etag mismatch. error from state store: ERR Error running script (call to f_9b5da7354cb61e2ca9faff50f6c43b81c73c0b94): @user_script:1: user_script:1: failed to delete Pixiemango-King||myKeyThere were no updates to HTTP in runtime https://github.com/dapr/dapr/blob/3481920cb533b46a9073e206aa215deb2a06e71e/pkg/http/api.go#L549, but I verified that that the error sent by Dapr runtime is passed through for http as well.
Caused by: io.dapr.exceptions.DaprException: ERR_STATE_DELETE: failed deleting state with key myKey: possible etag mismatch. error from state store: ERR Error running script (call to f_9b5da7354cb61e2ca9faff50f6c43b81c73c0b94): @user_script:1: user_script:1: failed to delete Mousespice-Roarer||myKeyThe updated state.png file is copied below for review.
Issue reference
Please reference the issue this PR will close: #437
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: