Skip to content
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

Dial Connection not being considered by context timeout #33

Open
mocyuto opened this issue Jun 23, 2021 · 1 comment
Open

Dial Connection not being considered by context timeout #33

mocyuto opened this issue Jun 23, 2021 · 1 comment

Comments

@mocyuto
Copy link

mocyuto commented Jun 23, 2021

We've ran into an issue where we set timeouts, but during high traffic/requests dax seems to not properly timeout.
We setup our dax client as below...

sess := session.Must(session.NewSession())
cfg := dax.DefaultConfig()
cfg.Credentials = sess.Config.Credentials
cfg.Region = region
cfg.HostPorts = []string{endpoint}
cfg.RequestTimeout = 300 * time.Millisecond
cfg.ReadRetries = 1                    // default is 2
cfg.MaxPendingConnectionsPerHost = 100 // default is 10
cfg.DialContext = (&net.Dialer{
  Timeout:   300 * time.Millisecond,
  KeepAlive: 30 * time.Second,
}).DialContext
client := dax.New(cfg)

During peak traffic hours we are seeing dax response take over 3 seconds.
I'm suspecting dial connection to be using context.TODO instead of request context.

https://github.com/aws/aws-dax-go/blob/master/dax/internal/client/tubepool.go#L318

Thank you in advance!

@mocyuto mocyuto changed the title Dial Connection is not considered context timeout Dial Connection not being considered by context timeout Jun 23, 2021
@miparnisari
Copy link

miparnisari commented Jun 7, 2023

@mocyuto were you able to find the root cause or a fix for this?

BTW the right code line now is https://github.com/aws/aws-dax-go/blob/master/dax/internal/client/tubepool.go#L341

Also see #46

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

No branches or pull requests

2 participants