Skip to content

connection timeout value fix for clients - #4966

Merged
xShinnRyuu merged 5 commits into
mainfrom
connection-timeout-test
Nov 13, 2025
Merged

xShinnRyuu merged 5 commits into
mainfrom
connection-timeout-test

Conversation

@xShinnRyuu

@xShinnRyuu xShinnRyuu commented Nov 12, 2025

Copy link
Copy Markdown
Collaborator

Description

  • Fixed the default connectionTimeout value from 250ms to 2000ms, aligning it with the documented value.
  • Added in addition logging to display both the Request timeout and Connection timeout values, even when they are not explicitly overridden during client creation.

Testing

Node client usage
Standalone Valkey server
// Before
2025-11-12T20:47:23.366643Z  INFO logger_core: Client lifetime - construct client
2025-11-12T20:47:23.367755Z  INFO logger_core: Connection configuration - 
Addresses: localhost:6379
TLS mode: No TLS
Standalone mode
Read from Replica mode: Only primary
database ID: 0
Protocol: RESP3
2025-11-12T20:47:23.372726Z  INFO logger_core: connection - new connection started
2025-11-12T20:47:23.373260Z  INFO logger_core: Client lifetime - connected to server
2025-11-12T20:47:23.374427Z  INFO logger_core: Client lifetime - disposing of client
Test completed - check logs above for timing information

// After
2025-11-12T20:51:27.261006Z  INFO logger_core: Client lifetime - socket connection established in 2ms
2025-11-12T20:51:27.261294Z  INFO logger_core: Client lifetime - construct client
2025-11-12T20:51:27.262340Z  INFO logger_core: Connection configuration - 
Addresses: localhost:6379
TLS mode: No TLS
Standalone mode
Request timeout: 250
Connection timeout: 2000
Read from Replica mode: Only primary
database ID: 0
Protocol: RESP3
2025-11-12T20:51:27.267170Z  INFO logger_core: connection - new connection started
2025-11-12T20:51:27.267690Z  INFO logger_core: Client lifetime - connected to server in 6ms
2025-11-12T20:51:27.267705Z  INFO logger_core: Client lifetime - total client creation time: 11ms
2025-11-12T20:51:27.268948Z  INFO logger_core: Client lifetime - disposing of client
Test completed - check logs above for timing information
Cluster Valkey server
// Before
2025-11-12T20:59:37.126317Z  INFO logger_core: Client lifetime - construct client
2025-11-12T20:59:37.127577Z  INFO logger_core: Connection configuration - 
Addresses: 127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002
TLS mode: No TLS
Cluster mode
Read from Replica mode: Only primary
database ID: 0
Protocol: RESP3
2025-11-12T20:59:37.130732Z  INFO redis::cluster_async: Connected to initial nodes:
127.0.0.1:7001 - 127.0.0.1
127.0.0.1:7002 - 127.0.0.1
127.0.0.1:7000 - 127.0.0.1

2025-11-12T20:59:37.131355Z  INFO redis::cluster_topology: calculate_topology found topology map:
TopologyView { hash_value: 2800636430690194391, nodes_count: 3, slots_and_count: (16381, [Slot { start: 0, end: 5460, master: "127.0.0.1:7000", replicas: ["127.0.0.1:7004"] }, Slot { start: 5461, end: 10922, master: "127.0.0.1:7002", replicas: ["127.0.0.1:7001"] }, Slot { start: 10923, end: 16383, master: "127.0.0.1:7003", replicas: ["127.0.0.1:7005"] }]) }
2025-11-12T20:59:37.139612Z  INFO redis::cluster_async: refresh_slots found nodes:
127.0.0.1:7002 - 127.0.0.1
127.0.0.1:7005 - 127.0.0.1
127.0.0.1:7001 - 127.0.0.1
127.0.0.1:7004 - 127.0.0.1
127.0.0.1:7003 - 127.0.0.1
127.0.0.1:7000 - 127.0.0.1

2025-11-12T20:59:37.139674Z  INFO logger_core: connection - new connection started
2025-11-12T20:59:37.140174Z  INFO logger_core: Client lifetime - connected to server
2025-11-12T20:59:37.141553Z  INFO logger_core: Client lifetime - disposing of client
Cluster test completed - check logs above for timing information


// After
2025-11-12T20:55:29.272937Z  INFO logger_core: Client lifetime - socket connection established in 1ms
2025-11-12T20:55:29.273086Z  INFO logger_core: Client lifetime - construct client
2025-11-12T20:55:29.273795Z  INFO logger_core: Connection configuration - 
Addresses: 127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002
TLS mode: No TLS
Cluster mode
Request timeout: 250
Connection timeout: 2000
Read from Replica mode: Only primary
database ID: 0
Protocol: RESP3
2025-11-12T20:55:29.276763Z  INFO redis::cluster_async: Connected to initial nodes:
127.0.0.1:7002 - 127.0.0.1
127.0.0.1:7000 - 127.0.0.1
127.0.0.1:7001 - 127.0.0.1

2025-11-12T20:55:29.277162Z  INFO redis::cluster_topology: calculate_topology found topology map:
TopologyView { hash_value: 2800636430690194391, nodes_count: 3, slots_and_count: (16381, [Slot { start: 0, end: 5460, master: "127.0.0.1:7000", replicas: ["127.0.0.1:7004"] }, Slot { start: 5461, end: 10922, master: "127.0.0.1:7002", replicas: ["127.0.0.1:7001"] }, Slot { start: 10923, end: 16383, master: "127.0.0.1:7003", replicas: ["127.0.0.1:7005"] }]) }
2025-11-12T20:55:29.282893Z  INFO redis::cluster_async: refresh_slots found nodes:
127.0.0.1:7001 - 127.0.0.1
127.0.0.1:7004 - 127.0.0.1
127.0.0.1:7005 - 127.0.0.1
127.0.0.1:7003 - 127.0.0.1
127.0.0.1:7000 - 127.0.0.1
127.0.0.1:7002 - 127.0.0.1

2025-11-12T20:55:29.282923Z  INFO logger_core: connection - new connection started
2025-11-12T20:55:29.283348Z  INFO logger_core: Client lifetime - connected to server in 10ms
2025-11-12T20:55:29.283358Z  INFO logger_core: Client lifetime - total client creation time: 13ms
2025-11-12T20:55:29.284383Z  INFO logger_core: Client lifetime - disposing of client
Cluster test completed - check logs above for timing information

Issue link

This Pull Request is linked to issue (URL): [REPLACE ME]

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>
Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>
Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>
Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

@yipin-chen yipin-chen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approve. You can merge once CIs are green.

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>
@xShinnRyuu
xShinnRyuu merged commit 3568485 into main Nov 13, 2025
65 of 69 checks passed
@xShinnRyuu
xShinnRyuu deleted the connection-timeout-test branch December 3, 2025 18:45
Copilot AI pushed a commit to synchronoss/valkey-glide that referenced this pull request Dec 4, 2025
* connection timeout value fix for clients

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Add in logging for connection timing

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Fix lint errors

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Add changelog and remove redundant imports

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Fix Go client timeout tests

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

---------

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>
netofontes pushed a commit to synchronoss/valkey-glide that referenced this pull request Dec 4, 2025
* connection timeout value fix for clients

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Add in logging for connection timing

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Fix lint errors

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Add changelog and remove redundant imports

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Fix Go client timeout tests

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

---------

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>
affonsov pushed a commit that referenced this pull request Aug 21, 2026
* connection timeout value fix for clients

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Add in logging for connection timing

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Fix lint errors

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Add changelog and remove redundant imports

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

* Fix Go client timeout tests

Signed-off-by: Thomas Zhou <thomas.zhou@improving.com>

---------

Signed-off-by: Thomas Zhou <thomas.zhou@improving.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