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

Use req.Close = true when using golang http client's NewRequest in parallel(goroutine) #43

Conversation

prashanthjbabu
Copy link

When running mender-stress-client for over 1000 clients , we sometimes get an EOF error from the http client library.
There are quite a few references on the internet which quote this problem :
https://stackoverflow.com/questions/28046100/golang-http-concurrent-requests-post-eof
https://stackoverflow.com/questions/17714494/golang-http-request-results-in-eof-errors-when-making-multiple-requests-successi/23963271#23963271
https://stackoverflow.com/questions/28046100/golang-http-concurrent-requests-post-eof#34474535
https://stackoverflow.com/questions/28046100/golang-http-concurrent-requests-post-eof#34474535

The solution is to use req.Close = true when using golang http client's NewRequest in parallel(goroutine) . This ensures that the connection isnt reused and the EOF error would not occur.

Changelog: Commit
Signed-off-by: Prashanth Joseph Babu prashanthjbabu@gmail.com

…parallel(goroutine)

Changelog: Commit
Signed-off-by: Prashanth Joseph Babu <prashanthjbabu@gmail.com>
@lluiscampos
Copy link
Contributor

Hi @prashanthjbabu and thank you for your efforts here.

This PR is changing vendor code, which means that you are actually modifying the upstream code of the mender client itself, see mender repo. In that is the actual bug, you should then submit it to mender and then update here. (But don't do it, read below)

Independently, we have plans to completely replace the code base in this repository in the next couple of weeks. We have been working internally in a much more efficient stress client, which is able to scale up to 100k devices with reasonable resources (2 CPU, 4 GB).

I am hence closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants