redis / lettuce

Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.
https://lettuce.io
MIT License
5.3k stars 949 forks source link

Send the CLIENT SETINFO command in a fire-and-forget way #2823

Closed tishun closed 2 months ago

tishun commented 2 months ago

Closes #2817

This solution aims to bring consistency between the Lettuce driver and most other drivers maintained by the Redis team. The current approach is - instead of probing for the version of the remote server and deciding based on that wether or not to send the CLIENT SETINFO command - to always send it and ignore the server response. There are two main reasons behind this: different flavors of the Redis server handle this in different versions and also the information sent is not critical to the operation of the driver, so failures should not necessary terminate the connection.

  1. Tested against Redis 6.0 - verified no connection failures are shown
  2. Tested against Redis (unstable) - verified no connection failures are shown; and that CLIENT LIST contains the expected data on the lib-name and lib-ver are set properly.
  3. Added unit tests

Make sure that:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 90.47619% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 77.73%. Comparing base (43843bf) to head (5dffa53). Report is 249 commits behind head on main.

:exclamation: Current head 5dffa53 differs from pull request most recent head 9e9483a. Consider uploading reports for the commit 9e9483a to get more accurate results

Files Patch % Lines
src/main/java/io/lettuce/core/RedisHandshake.java 90.47% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2823 +/- ## ============================================ - Coverage 78.71% 77.73% -0.98% - Complexity 6786 7241 +455 ============================================ Files 508 539 +31 Lines 22765 24491 +1726 Branches 2446 2607 +161 ============================================ + Hits 17919 19039 +1120 - Misses 3717 4255 +538 - Partials 1129 1197 +68 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.