Skip to content

Commit

Permalink
Use ScyllaShardAwareDialer as a default dialer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zimnx authored and mmatczuk committed Jul 15, 2022
1 parent a821d28 commit e6fdf89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions connectionpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ func connConfig(cfg *ClusterConfig) (*ConnConfig, error) {

dialer := cfg.Dialer
if dialer == nil {
d := &net.Dialer{
d := net.Dialer{
Timeout: cfg.ConnectTimeout,
}
if cfg.SocketKeepalive > 0 {
d.KeepAlive = cfg.SocketKeepalive
}
dialer = d
dialer = &ScyllaShardAwareDialer{d}
}

hostDialer = &scyllaDialer{
Expand Down

0 comments on commit e6fdf89

Please sign in to comment.