Skip to content

Commit e6fdf89

Browse files
zimnxmmatczuk
authored andcommitted
Use ScyllaShardAwareDialer as a default dialer
PR #98 introduced a regression which changed default dialer to bare net.Dialer, instead of wrapped one with ScyllaShardAwareDialer. This resulted in dialer not being able to set local address which are required for correct shard assignment. Even though we have an integration test for that, test environment has only 2 shards, so it's possible that random port assignment passes it.
1 parent a821d28 commit e6fdf89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

connectionpool.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ func connConfig(cfg *ClusterConfig) (*ConnConfig, error) {
105105

106106
dialer := cfg.Dialer
107107
if dialer == nil {
108-
d := &net.Dialer{
108+
d := net.Dialer{
109109
Timeout: cfg.ConnectTimeout,
110110
}
111111
if cfg.SocketKeepalive > 0 {
112112
d.KeepAlive = cfg.SocketKeepalive
113113
}
114-
dialer = d
114+
dialer = &ScyllaShardAwareDialer{d}
115115
}
116116

117117
hostDialer = &scyllaDialer{

0 commit comments

Comments
 (0)