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

Handle server errors in array response. #1056

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

nihohit
Copy link
Contributor

@nihohit nihohit commented Feb 12, 2024

Currently server errors stop the parser and return a RedisError. This caused errors that are returned inside an array, such as transaction errors, to cause the rest of the array to not be parsed.
This is solved by adding an internal value type that includes the server errors, so when parsing to the internal value type, the array will finish parsing, and then extracting the error.

Pros:

  • backwards compatible
  • allows us to replace the parsing backend (for redis-protocol?) without affecting the users.

cons:

  • repetition - some changes to Value might need to be copied to InternalValue.
  • adds some conversion overhead

@nihohit
Copy link
Contributor Author

nihohit commented Feb 12, 2024

possible solution to #984

@nihohit nihohit marked this pull request as ready for review February 29, 2024 19:50
@nihohit nihohit force-pushed the fix-parsing-internal-value branch 2 times, most recently from c73b18e to 64553e4 Compare March 1, 2024 05:12
@nihohit
Copy link
Contributor Author

nihohit commented Mar 1, 2024

@jaymell ready for review

@nihohit nihohit force-pushed the fix-parsing-internal-value branch from 64553e4 to 82b1cec Compare March 1, 2024 06:54
Currently server errors stop the parser and return a RedisError. This caused errors that are returned inside an array, such as transaction errors, to cause the rest of the array to not be parsed.
This is solved by adding an internal value type that includes the server errors, so when parsing to the internal value type, the array will finish parsing, and then extracting the error.
@nihohit nihohit force-pushed the fix-parsing-internal-value branch from 82b1cec to b979685 Compare March 1, 2024 07:29
@nihohit nihohit merged commit 069a952 into redis-rs:main Mar 8, 2024
10 checks passed
@nihohit nihohit deleted the fix-parsing-internal-value branch March 8, 2024 06:40
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.

None yet

2 participants