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

Java: JSON.MGET. #2514

Open
wants to merge 1 commit into
base: release-1.2
Choose a base branch
from

Conversation

Yury-Fridlyand
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand commented Oct 24, 2024

Issue link

#2430
Also fixes #2514

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Commits will be squashed upon merging.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@Yury-Fridlyand Yury-Fridlyand added the java issues and fixes related to the java client label Oct 24, 2024
@Yury-Fridlyand Yury-Fridlyand requested a review from a team as a code owner October 24, 2024 20:56
@Yury-Fridlyand Yury-Fridlyand changed the title JSON.MGET. Java: JSON.MGET. Oct 24, 2024
@@ -264,7 +264,6 @@ pub(crate) fn combine_and_sort_array_results<'a>(
for (key_indices, value) in sorting_order.into_iter().zip(values) {
match value {
Value::Array(values) => {
assert_eq!(values.len(), key_indices.len());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This assert isn't correct, because key_indices contains argument indices, where not all args are keys. It also produces a useless message if fails:

thread '<unnamed>' panicked at glide-core/redis-rs/redis/src/cluster_routing.rs:269:17:
assertion `left == right` failed
  left: 1
 right: 2
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2024-10-24T19:14:37.701195Z  WARN logger_core: received error - Received connection error `redis_cluster: Unable to receive command`. Will attempt to reconnect

As an option we can restore the assert, but make it producing a meaningful error and check an extra condition shipped in ResponsePolicy::CombineArrays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java issues and fixes related to the java client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow sending keys from different slots on JSON.MGET for CME
1 participant