Skip to content

Add CLIENT SETINFO support to identify spark-redis connections in Redis server#401

Open
viktoriya-kutsarova wants to merge 1 commit intoRedisLabs:masterfrom
viktoriya-kutsarova:add-client-setinfo
Open

Add CLIENT SETINFO support to identify spark-redis connections in Redis server#401
viktoriya-kutsarova wants to merge 1 commit intoRedisLabs:masterfrom
viktoriya-kutsarova:add-client-setinfo

Conversation

@viktoriya-kutsarova
Copy link
Copy Markdown

This PR implements client library identification on Redis servers using the CLIENT SETINFO command. When connections are established, the connector now automatically registers itself with Redis, allowing server administrators to identify and monitor spark-redis client connections.

Key Changes

  • Added RedisClientLibraryInfo object to encapsulate library name and version information extracted from the package manifest
  • Created custom SparkRedisJedisFactory extending JedisFactory to send CLIENT SETINFO at connection creation time (not on every pool borrow)
  • Uses fire-and-forget approach with debug logging for backward compatibility with Redis versions < 7.2
  • Added comprehensive test suite (ConnectionPoolTest) to verify client info registration and connection pooling behavior

Client Info Format

  • LIB-NAME: jedis(spark-redis_v{version}) - version extracted from JAR manifest or "unknown" in development
  • LIB-VER: Jedis version (e.g., 3.9.0)

Copy link
Copy Markdown
Collaborator

@tishun tishun left a comment

Choose a reason for hiding this comment

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

LGTM

@viktoriya-kutsarova
Copy link
Copy Markdown
Author

The tests are failing because the server version in the CI pipeline is Redis 6.0.10, so setting the library name and version is expected to fail.

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.

2 participants