Closed michaelperel closed 3 years ago
Adding a picture showing the number of sockets just increasing within a few minutes and causing the Telegraf container to crash.
The above PR fixes this problem and the container is much more stable now.
Thanks @amenzhinsky - When will you cut a release so we can easily reference it in our project?
@sujitdmello sure https://github.com/amenzhinsky/iothub/releases/tag/v0.6.1
Created with @batslyadams @sujitdmello @giventocode
This PR fixes 2 bugs: (1) In
edgeSignRequest
the response body is never closed, causing resource leaks. (2) InedgeSignRequest
each function call uses its own http client. This causes thousands of connections, and eventually crashes our module and the iotedge runtime within a few minutes. It exhausts the pool of sockets on a ubuntu based linux vm.With this PR: (1) The response body is closed. (2) The http client is initialized once and shared thereafter.
Here is a picture of the new behavior, where only a few connections are made:
Before this PR, after about ~5 minutes, there were over 3600 unix connections which eventually exhausted the resources.
@haylesnortal, would you be able to give this a review? We want to merge this so we can reference it in the telegraf module, instead of using a fork. Thanks :)