Skip to content

Conversation

vmihailenco
Copy link
Collaborator

Fixes #1071

@vmihailenco vmihailenco merged commit 73d3c18 into master Jun 29, 2019
@vmihailenco vmihailenco deleted the fix/failover-dialer-when-available branch June 29, 2019 09:53
@MonstyB
Copy link

MonstyB commented Jun 29, 2019

Hi, I pulled the updated master but it is still not working.

Custom dialer gets overridden by default dialer.

This is my client declaration :

client = redis.NewFailoverClient(&redis.FailoverOptions{ MasterName: masterName, SentinelAddrs: []string{clusterNode1, clusterNode2, clusterNode3}, Password: password, Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { // This dialer is not used : must be a bug fmt.Println("Connecting to SOCKS5 prior to this.") dialer, err := proxy.SOCKS5("tcp", socksProxyHost, nil, proxy.Direct) if err != nil { fmt.Println("Oops, cannot connect to the proxy :", err) } return dialer.Dial(network, addr) }, })

I tried to comment out :
opt.Dialer = c.dial in sentinel.go and it finally went through my custom Dialer but unfortunately, "addr" is valued to "FailoverClient" so it can't connect to Redis.

vmihailenco added a commit that referenced this pull request Mar 11, 2020
…able

Use Dialer in Sentinel failover when available
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.

Custom Dialer not taken into account in FailoverClient
2 participants