Skip to content

Faster dial timeout errors #170

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/new_redis_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func NewRedisClient(addr string) *redis.Client {
return redis.NewClient(&redis.Options{
Addr: addr,
DialTimeout: 5 * time.Second,
DialTimeout: 2 * time.Second,
Dialer: func() (net.Conn, error) {
attempts := 0

Expand All @@ -29,8 +29,8 @@ func NewRedisClient(addr string) *redis.Client {
return nil, err
}

// 50 * 100ms = 5s
if attempts > 50 {
// 20 * 100ms = 2s
if attempts > 20 {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/test_bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func testBindToPort(stageHarness *test_case_harness.TestCaseHarness) error {

bindTestCase := test_cases.BindTestCase{
Port: 6379,
Retries: 15,
Retries: 5,
}

return bindTestCase.Run(b, logger)
Expand Down
2 changes: 1 addition & 1 deletion internal/test_repl_bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func testReplBindToCustomPort(stageHarness *test_case_harness.TestCaseHarness) e

bindTestCase := test_cases.BindTestCase{
Port: port,
Retries: 15,
Retries: 5,
}

return bindTestCase.Run(b, logger)
Expand Down
Loading