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

Guard value parameters against null values. #291

Closed
christophstrobl opened this issue Jun 27, 2016 · 1 comment
Closed

Guard value parameters against null values. #291

christophstrobl opened this issue Jun 27, 2016 · 1 comment
Labels
type: bug A general bug
Milestone

Comments

@christophstrobl
Copy link
Contributor

Using null values on commands that do not expect null causes NPE on invocation. The error in MessageToByteEncoder.write is swallowed. This then causes a RedisCommandTimeoutException- instead of the actual error.

connection.append("mp911de".getBytes(), null);
@mp911de mp911de added the type: bug A general bug label Jun 27, 2016
@mp911de mp911de added this to the Lettuce 4.2.1 milestone Jun 27, 2016
mp911de added a commit that referenced this issue Jun 27, 2016
Clarified the responsibility of null handling and guard ByteArrayCodec against null values. Null keys and null values are passed down to the codec and need to be handled inside of a Codec. This allows special handling/encoding of absent key and value-typed elements.

Encoding errors are propagated to the appropriate command.
mp911de added a commit that referenced this issue Jun 27, 2016
Clarified the responsibility of null handling and guard ByteArrayCodec against null values. Null keys and null values are passed down to the codec and need to be handled inside of a Codec. This allows special handling/encoding of absent key and value-typed elements.

Encoding errors are propagated to the appropriate command.
mp911de added a commit that referenced this issue Jun 27, 2016
Clarified the responsibility of null handling and guard ByteArrayCodec against null values. Null keys and null values are passed down to the codec and need to be handled inside of a Codec. This allows special handling/encoding of absent key and value-typed elements.

Encoding errors are propagated to the appropriate command.
mp911de added a commit that referenced this issue Jun 27, 2016
Clarified the responsibility of null handling and guard ByteArrayCodec against null values. Null keys and null values are passed down to the codec and need to be handled inside of a Codec. This allows special handling/encoding of absent key and value-typed elements.

Encoding errors are propagated to the appropriate command.
mp911de added a commit that referenced this issue Jun 27, 2016
Clarified the responsibility of null handling and guard ByteArrayCodec against null values. Null keys and null values are passed down to the codec and need to be handled inside of a Codec. This allows special handling/encoding of absent key and value-typed elements.

Encoding errors are propagated to the appropriate command.
@mp911de
Copy link
Collaborator

mp911de commented Jun 27, 2016

null keys get rejected now. null values are allowed in certain cases. Encoding errors are propagated to the command and no longer cause a timeout. null value handling lies in the responsibility of a RedisCodec. Encoding errors can break the connection protocol state synchronization and so a connection needs to be closed after running into an EncoderException.

@mp911de mp911de closed this as completed Jun 27, 2016
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