Skip to content

Conversation

@tishun
Copy link
Collaborator

@tishun tishun commented Dec 6, 2025

Cross-porting #3443 from the integration branch


Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

* Correctly handling the encoding error for Lettuce [POC]

Summary:
Add encoding error tracking to prevent command queue corruption

  - Add markEncodingError() and hasEncodingError() methods to RedisCommand interface
  - Implement encoding error flag in Command class with volatile boolean
  - Mark commands with encoding errors in CommandEncoder on encode failures
  - Add lazy cleanup of encoding failures in CommandHandler response processing
  - Update all RedisCommand implementations to support encoding error tracking
  - Add comprehensive unit tests and integration tests for encoding error handling

Fixes issue where encoding failures could corrupt the outstanding command queue by leaving failed commands in the stack without proper cleanup, causing responses to be matched to wrong commands.

Test Plan: UTs, Integration testing

Reviewers: yayang, ureview

Reviewed By: yayang

Tags: #has_java

JIRA Issues: REDIS-14050

Differential Revision: https://code.uberinternal.com/D19068147

* Fix error command handling code logic and add integration test for encoding failure

Summary: Fix error command handling code logic and add integration test for encoding failure

Test Plan: unittest, integration test

Reviewers: #ldap_storage_sre_cache, ureview, jingzhao

Reviewed By: #ldap_storage_sre_cache, jingzhao

Tags: #has_java

JIRA Issues: REDIS-14192

Differential Revision: https://code.uberinternal.com/D19271701

* latest changes

* Addressing the reactive streams issue

* Addressing the encoding issues
Addressing some general cases

* Formatting issues

* Test failures addressed

* Polishing

---------

Co-authored-by: Jing Zhao <jingzhao@uber.com>
Co-authored-by: Tihomir Mateev <tihomir.mateev@gmail.com>
@tishun tishun changed the title Fix command queue corruption on encoding failures (#3443) Fix command queue corruption on encoding failures (#3443) (7.1.x) Dec 6, 2025
@a-TODO-rov a-TODO-rov added this to the 7.1.1.RELEASE milestone Dec 15, 2025
@a-TODO-rov a-TODO-rov merged commit c8666fd into redis:7.1.x Dec 15, 2025
11 checks passed
a-TODO-rov pushed a commit that referenced this pull request Dec 15, 2025
* Correctly handling the encoding error for Lettuce [POC]

Summary:
Add encoding error tracking to prevent command queue corruption

  - Add markEncodingError() and hasEncodingError() methods to RedisCommand interface
  - Implement encoding error flag in Command class with volatile boolean
  - Mark commands with encoding errors in CommandEncoder on encode failures
  - Add lazy cleanup of encoding failures in CommandHandler response processing
  - Update all RedisCommand implementations to support encoding error tracking
  - Add comprehensive unit tests and integration tests for encoding error handling

Fixes issue where encoding failures could corrupt the outstanding command queue by leaving failed commands in the stack without proper cleanup, causing responses to be matched to wrong commands.

Test Plan: UTs, Integration testing

Reviewers: yayang, ureview

Reviewed By: yayang

Tags: #has_java

JIRA Issues: REDIS-14050

Differential Revision: https://code.uberinternal.com/D19068147

* Fix error command handling code logic and add integration test for encoding failure

Summary: Fix error command handling code logic and add integration test for encoding failure

Test Plan: unittest, integration test

Reviewers: #ldap_storage_sre_cache, ureview, jingzhao

Reviewed By: #ldap_storage_sre_cache, jingzhao

Tags: #has_java

JIRA Issues: REDIS-14192

Differential Revision: https://code.uberinternal.com/D19271701

* latest changes

* Addressing the reactive streams issue

* Addressing the encoding issues
Addressing some general cases

* Formatting issues

* Test failures addressed

* Polishing

---------

Co-authored-by: yang <43356004+yangy0000@users.noreply.github.com>
Co-authored-by: Jing Zhao <jingzhao@uber.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants