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

Redis Client: fix NPE when constructing XPendingSummary #45687

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Jan 17, 2025

Certain fields that were deemed to be mandatory can in fact be null, as demonstrated in newly added tests.

Also, this commit fixes translating XTrimArgs to the actual argument array in case MAXLEN is set to 0. That is, in fact, a valid value, as demonstrated by the newly added tests and also by inspecting Redis source code [1].

[1] https://github.com/redis/redis/blob/7.2.4/src/t_stream.c#L941

Fixes #45682

Certain fields that were deemed to be mandatory can in fact be `null`,
as demonstrated in newly added tests.

Also, this commit fixes translating `XTrimArgs` to the actual argument
array in case `MAXLEN` is set to `0`. That is, in fact, a valid value,
as demonstrated by the newly added tests and also by inspecting Redis
source code [1].

[1] https://github.com/redis/redis/blob/7.2.4/src/t_stream.c#L941
Copy link

quarkus-bot bot commented Jan 17, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 84d57f6.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

I added a small question but in general LGTM.

I will let @cescoffier approve and merge though.

consumers.put(nested.get(0).toString(), nested.get(1).toLong());
if (r.get(3) != null) {
for (Response nested : r.get(3)) {
consumers.put(nested.get(0).toString(), nested.get(1).toLong());
Copy link
Member

Choose a reason for hiding this comment

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

In there we are sure the values are not null? If so, LGTM!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure that both the keys and the values are never null, but not completely, to be honest.

Copy link
Member

Choose a reason for hiding this comment

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

me neither - it's not really said on the command documentation. I think it's good to go.

consumers.put(nested.get(0).toString(), nested.get(1).toLong());
if (r.get(3) != null) {
for (Response nested : r.get(3)) {
consumers.put(nested.get(0).toString(), nested.get(1).toLong());
Copy link
Member

Choose a reason for hiding this comment

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

me neither - it's not really said on the command documentation. I think it's good to go.

@cescoffier cescoffier merged commit cd5792e into quarkusio:main Jan 19, 2025
32 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.19 - main milestone Jan 19, 2025
@Ladicek Ladicek deleted the fix-redis-xpending-summary-npe branch January 20, 2025 07:38
@gsmet gsmet modified the milestones: 3.19 - main, 3.18.0 Jan 21, 2025
@gsmet gsmet modified the milestones: 3.18.0, 3.17.8 Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

decodeAsXPendingSummary NPE on r.get(1) or r.get(2)
3 participants