Add Tequilapi client timeout - #460
Merged
Merged
Conversation
soffokl
reviewed
Oct 18, 2018
soffokl
previously approved these changes
Oct 18, 2018
soffokl
left a comment
Member
There was a problem hiding this comment.
Looks good to me, but CI build should pass.
soffokl
previously approved these changes
Oct 18, 2018
Waldz
previously approved these changes
Oct 18, 2018
Golang convention is to use capital letters for acronyms. We should use the variable identifier baseURL instead of baseUrl. Replace variable identifier `baseUrl` with `baseURL`. Signed-off-by: Tobin C. Harding <me@tobin.cc>
Golang convention is to use capital letters for acronyms. We should use the variable identifier newHTTPClient instead of newHttpClient. Replace variable identifier `newHttpClient` with `newHTTPClient`. Signed-off-by: Tobin C. Harding <me@tobin.cc>
Currently the tequilapi does not use a timeout. From github issue #386 this means that if connection issues arise, the current implementation of the tequilapi/client will hang FOREVER http.Client includes a data member for setting a timeout. Set timeout to 120 seconds when creating new `http.Client` in tequilapi client. Signed-off-by: Tobin C. Harding <me@tobin.cc>
Contributor
Author
soffokl
approved these changes
Oct 19, 2018
soffokl
left a comment
Member
There was a problem hiding this comment.
Don't worry about applying my suggestion via Github. )
Waldz
approved these changes
Oct 22, 2018
Waldz
approved these changes
Oct 22, 2018
Waldz
approved these changes
Oct 22, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As described in issue #386 current tequilapi client does not use a timeout. In current go version (1.11) stdlib
http.Clientdoes implement timeout functionality (also available in 1.9 and 1.10).From
/usr/lib/go/src/net/http/client.go(golang version 1.11.1):We can use this to add a timeout to the tequilapi client.
First do a couple of clean up patches in
tequilapi/client, with this PR appliedtequilapi/client/*.golint cleanly. Use capital letters for acronyms as is standard Golang convention. Then add timeout of 120 seconds to the tequilapi client.Tested by setting timeout to 1 nanosecond and running client
Closes: #386
Signed-off-by: Tobin C. Harding me@tobin.cc