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

ArrayOutput stops response parsing on empty nested arrays #1327

Closed
TheCycoONE opened this issue Jun 29, 2020 · 5 comments
Closed

ArrayOutput stops response parsing on empty nested arrays #1327

TheCycoONE opened this issue Jun 29, 2020 · 5 comments
Labels
type: bug A general bug
Milestone

Comments

@TheCycoONE
Copy link

Bug Report

Current Behavior

When using the redis-cell module v0.2.5 the list of redis commands that Lettuce loads is truncated.

In ReidsCommandFactory.java I put a breakpoint at the return of getCommands - from there I can see that commands contains 137 elements when the redis-cell module is loaded, and 204 when it is not loaded.

In redis-cli I run monitor and see the COMMAND is used to get the list of commands. When I run that with redis-cell loaded I get 205 entries.

Looking at the list of entries I see the 138th entry is

138) 1) "cl.throttle"
     2) (integer) -1
     3) 1) write
     4) (integer) 0
     5) (integer) 0
     6) (integer) 0
     7) (empty array)

For some reason Lettuce stops reading the list of commands at that point.

Expected behavior/code

The full list of 205 commands should be returned. My custom "CL.THROTTLE" lettuce command should work.

Environment

  • Lettuce version(s): 5.3.1
  • Redis version: 6.0.1
  • redis-cell 0.2.5
@TheCycoONE TheCycoONE added the type: bug A general bug label Jun 29, 2020
@TheCycoONE
Copy link
Author

I knew this was all working 2 years ago, so I've played with older versions. Downgrading redis to 5.0.8 fixes the issue; so it is a redis 6 specific problem.

@TheCycoONE TheCycoONE changed the title command list is incomplete when using redis-cell module command list is incomplete when using redis-cell module with redis 6 Jun 29, 2020
@TheCycoONE
Copy link
Author

In redis 5.0.8 the command output is slightly different (missing the empty array element).

 30) 1) "cl.throttle"
     2) (integer) -1
     3) 1) write
     4) (integer) 0
     5) (integer) 0
     6) (integer) 0

@mp911de
Copy link
Collaborator

mp911de commented Jun 30, 2020

Thanks for reporting the issue. The bug is that ArrayOutput doesn't consider nested empty arrays and therefore response processing terminates once the response contains an empty array element.

 69) 1) "hget"
     2) (integer) 3
     3) 1) readonly
        2) fast
     4) (integer) 1
     5) (integer) 1
     6) (integer) 1
     7) 1) @read
        2) @hash
        3) @fast
 70) 1) "cl.throttle"
     2) (integer) -1
     3) 1) write
     4) (integer) 1
     5) (integer) 1
     6) (integer) 1
     7) (empty array)

@mp911de mp911de added this to the 5.3.2 milestone Jun 30, 2020
@mp911de mp911de changed the title command list is incomplete when using redis-cell module with redis 6 ArrayOutput stops response parsing on empty nested arrays Jun 30, 2020
mp911de added a commit that referenced this issue Jun 30, 2020
ArrayOutput is now a subclass of NestedMultiOutput which correctly handles empty arrays.
mp911de added a commit that referenced this issue Jun 30, 2020
ArrayOutput is now a subclass of NestedMultiOutput which correctly handles empty arrays.
@mp911de
Copy link
Collaborator

mp911de commented Jun 30, 2020

That's fixed now in 5.3.2.BUILD-SNAPSHOT. Care to check whether the snapshot build fixes your issue?

@mp911de mp911de closed this as completed Jun 30, 2020
@TheCycoONE
Copy link
Author

Confirmed working with 5.3.2.BUILD-SNAPSHOT. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants