Skip to content

Unable to get an error while using opsForHash().get() command #2210

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

Closed
MariaNosareva opened this issue Dec 8, 2021 · 1 comment
Closed
Assignees
Labels
type: regression A regression from a previous release

Comments

@MariaNosareva
Copy link

Hi,
I came across some strange behavior while working with ReactiveHashOperations: it seems that there is no error propagation in the case of getting value from hash by only one key (.get(key) method).

result = cmd.hget(command.getKey(), key.duplicate()).map(value -> KeyValue.fromNullable(key, value))
.map(Collections::singletonList).onErrorReturn(Collections.emptyList());

For example, if the service has trouble reconnecting to Redis, the endpoint user of that method will never know if any problems exist. But in the case of using .multiGet() (uses the same method under the hood - hMGet()) there is no such issue, all errors are delivered well.

Is there any chance of changing this behavior?

Thanks!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 8, 2021
@mp911de mp911de added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 10, 2021
@mp911de mp911de self-assigned this Dec 10, 2021
@mp911de
Copy link
Member

mp911de commented Dec 10, 2021

Thanks for reporting the issue. It is indeed a regression in which the empty response should return a collection with an empty element.

mp911de added a commit that referenced this issue Dec 10, 2021
…ns.hMGet(…) for a single key returns no value.

We now return a list containing a single empty KeyValue element when ReactiveHashOperations.hMGet(…) called for a single key returns no value.

Previously, the code used onErrorReturn(…) which returned the wrong value and suppressed errors.

Closes #2210
mp911de added a commit that referenced this issue Dec 10, 2021
…ns.hMGet(…) for a single key returns no value.

We now return a list containing a single empty KeyValue element when ReactiveHashOperations.hMGet(…) called for a single key returns no value.

Previously, the code used onErrorReturn(…) which returned the wrong value and suppressed errors.

Closes #2210
@mp911de mp911de added this to the 2.5.8 (2021.0.8) milestone Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants