Skip to content

Fixed the problem of abnormal socket status during DNS resolution - #2849

Merged
sazzad16 merged 3 commits into
redis:masterfrom
yangbodong22011:fix-resolve-dns-fail
Jan 31, 2022
Merged

sazzad16 merged 3 commits into
redis:masterfrom
yangbodong22011:fix-resolve-dns-fail

Conversation

@yangbodong22011

Copy link
Copy Markdown
Contributor

fix #2848

@sazzad16 sazzad16 added this to the 4.1.1 milestone Jan 27, 2022
dengliming
dengliming previously approved these changes Jan 27, 2022
@codecov-commenter

codecov-commenter commented Jan 27, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #2849 (727a08a) into master (195d59e) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2849      +/-   ##
============================================
+ Coverage     58.24%   58.32%   +0.08%     
- Complexity     3099     3100       +1     
============================================
  Files           177      177              
  Lines         11171    11171              
  Branches        637      637              
============================================
+ Hits           6507     6516       +9     
+ Misses         4442     4435       -7     
+ Partials        222      220       -2     
Impacted Files Coverage Δ
...redis/clients/jedis/DefaultJedisSocketFactory.java 93.42% <100.00%> (ø)
src/main/java/redis/clients/jedis/Jedis.java 84.82% <0.00%> (+0.05%) ⬆️
...in/java/redis/clients/jedis/JedisSentinelPool.java 71.67% <0.00%> (+2.89%) ⬆️
...a/redis/clients/jedis/resps/AccessControlUser.java 82.14% <0.00%> (+3.57%) ⬆️
...in/java/redis/clients/jedis/ConnectionFactory.java 67.34% <0.00%> (+4.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 195d59e...727a08a. Read the comment docs.

@sazzad16
sazzad16 requested a review from dengliming January 27, 2022 10:17

@sazzad16 sazzad16 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We used to setSoTimeout after successful connect.

HostAndPort _hostAndPort = getSocketHostAndPort();
socket.connect(new InetSocketAddress(_hostAndPort.getHost(), _hostAndPort.getPort()), connectionTimeout);
socket.setSoTimeout(socketTimeout);

@sazzad16

Copy link
Copy Markdown
Contributor

@yangbodong22011

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
@yangbodong22011

Copy link
Copy Markdown
Contributor Author

@yangbodong22011

@sazzad16 Thanks for you suggestions, merged.

@sazzad16
sazzad16 merged commit 9d668d7 into redis:master Jan 31, 2022
sazzad16 added a commit that referenced this pull request Jan 31, 2022
)

* Fixed the problem of abnormal socket status during DNS resolution

fix #2848

* Apply suggestions from code review

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jedis connect failed when using dns resolver in jedis 4.1.0

4 participants