Skip to content

Commit

Permalink
close the APM client response body regardless of the response (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivantopo authored Nov 2, 2022
1 parent 5b96b05 commit 92f2e3a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ class ApiClient(settings: Settings) {

tryPosting match {
case Success(response) =>
// The response body must be closed (even if there is no body in the response),
// otherwise OkHttp leaks connections.
response.body().close()

response.code() match {
case 200 =>
_logger.trace("Request to the Kamon APM [{}] endpoint succeeded", endpointName)
Expand Down

0 comments on commit 92f2e3a

Please sign in to comment.