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

Support report libname and libver to Redis #3356

Merged
merged 5 commits into from
Apr 7, 2023

Conversation

yangbodong22011
Copy link
Collaborator

@yangbodong22011 yangbodong22011 commented Apr 4, 2023

Reference: redis/redis#11758
Resolves #3338

Copy link
Collaborator

@sazzad16 sazzad16 left a comment

Choose a reason for hiding this comment

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

Error:  testCredentialsProvider(redis.clients.jedis.JedisPooledTest)  Time elapsed: 0.01 s  <<< ERROR!
redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
	at redis.clients.jedis.JedisPooledTest.testCredentialsProvider(JedisPooledTest.java:246)

src/main/java/redis/clients/jedis/Connection.java Outdated Show resolved Hide resolved
src/main/java/redis/clients/jedis/Connection.java Outdated Show resolved Hide resolved
@redis redis deleted a comment from codecov-commenter Apr 7, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2023

Codecov Report

Patch coverage: 78.84% and project coverage change: +0.03 🎉

Comparison is base (58f5761) 67.11% compared to head (a925493) 67.14%.

❗ Current head a925493 differs from pull request most recent head 1fba4ea. Consider uploading reports for the commit 1fba4ea to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3356      +/-   ##
============================================
+ Coverage     67.11%   67.14%   +0.03%     
- Complexity     4680     4690      +10     
============================================
  Files           266      268       +2     
  Lines         15133    15179      +46     
  Branches        952      959       +7     
============================================
+ Hits          10156    10192      +36     
- Misses         4565     4573       +8     
- Partials        412      414       +2     
Impacted Files Coverage Δ
src/main/java/redis/clients/jedis/Jedis.java 84.85% <50.00%> (-0.11%) ⬇️
...n/java/redis/clients/jedis/util/JedisMetaInfo.java 75.00% <75.00%> (ø)
src/main/java/redis/clients/jedis/Connection.java 80.99% <81.81%> (-0.38%) ⬇️
src/main/java/redis/clients/jedis/Protocol.java 89.50% <100.00%> (-1.24%) ⬇️
...edis/clients/jedis/args/ClientAttributeOption.java 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yangbodong22011
Copy link
Collaborator Author

yangbodong22011 commented Apr 7, 2023

client list output is (4.5.0-SNAPSHOT is my local jar)

id=109 addr=127.0.0.1:64276 laddr=127.0.0.1:6379 fd=10 name= age=26 idle=2 flags=N db=0 sub=0 psub=0 ssub=0 multi=-1 qbuf=0 qbuf-free=16890 argv-mem=0 multi-mem=0 rbs=1024 rbp=0 obl=0 oll=0 omem=0 tot-mem=18704 events=r cmd=get user=default redir=-1 resp=2 lib-name=jedis lib-ver=4.5.0-SNAPSHOT

Comment on lines +8524 to +8530
@Override
public String clientSetInfo(ClientAttributeOption attr, String value) {
checkIsInMultiOrPipeline();
connection.sendCommand(CLIENT, SETINFO.getRaw(), attr.getRaw(), encode(value));
return connection.getStatusCodeReply();
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

[Discussion]

@yangbodong22011 WDYT about removing this support from Jedis class? Meaning to keep the usages of SETINFO only internally.

redis/redis#11758 mentions it is for Client libraries, not necessarily for users.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hope to keep the status quo. Although users do not need to actively set it in most cases, if users want to force it, we can still support it. And redis-cli or sendCommand can also accomplish the same function.

@sazzad16 sazzad16 merged commit 5192937 into redis:master Apr 7, 2023
@sazzad16 sazzad16 added this to the 4.4.0 milestone Apr 7, 2023
sazzad16 added a commit to sazzad16/jedis that referenced this pull request Apr 27, 2023
@pvarga88
Copy link

Due to this change, Jedis 4.4.0 does not work with pre-7.2 Redis servers.
You seem to have ignored the wisdom from this page:
https://redis.io/commands/client-setinfo/

Client libraries are expected to pipeline this command after authentication on all connections and ignore failures since they could be connected to an older version that doesn't support them.

@sazzad16
Copy link
Collaborator

@pvarga88

Please state which Redis version you are using. It'd be more helpful with the error, stacktrace, etc.

The doc just says ignore failures but doesn't specify those failures. We tried to identify failures as much as we could.

According to my testing, this works fine from Redis 6.2. According to my knowledge, this should work fine from Redis 5.0.
@yangbodong22011 may be able to confirm further.

That leaves us pre-5.0. Frankly, that's not officially supported anymore.

@pvarga88
Copy link

Ah, my apologies. This is indeed with a very old Redis server. I didn't expect that would affect Jedis' error handling.

@sazzad16
Copy link
Collaborator

@pvarga88 No problem. Sharing information is how we can improve. FYI, there can be a fix coming for Redis 4.0

mkeckmkeck added a commit to scireum/sirius-db that referenced this pull request May 27, 2024
- fixes library usage for jupiter by applying an disabled ClientSetInfoConfig
- see https://redis.io/docs/latest/commands/client-setinfo/ and
  redis/jedis#3356 (has follow-ups)

Fixes: SIRI-921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support client name and version report
4 participants