Skip to content

dialvia: add connect timeout#789

Merged
mmatczuk merged 4 commits intomainfrom
hg/connect_timeout
Apr 30, 2024
Merged

dialvia: add connect timeout#789
mmatczuk merged 4 commits intomainfrom
hg/connect_timeout

Conversation

@Choraden
Copy link
Contributor

Fixes #781

@Choraden
Copy link
Contributor Author

Thinking about the http.Transport behaviour[1] maybe we should be doing the same. This is always set a constant 60s timeout not to leak any goroutines. After all we support context cancellation.

[1] https://cs.opensource.google/go/go/+/refs/tags/go1.22.2:src/net/http/transport.go;l=1727

@mmatczuk
Copy link
Contributor

This looks good to me.

	newCtx, cancel := context.WithTimeout(ctx, 1*time.Minute)

@mmatczuk mmatczuk merged commit deca0e5 into main Apr 30, 2024
@mmatczuk mmatczuk deleted the hg/connect_timeout branch April 30, 2024 09:30
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.

dialvia: add connect timeout

2 participants