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

Traffic Stats: reuse http influx client #7022

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

rawlinp
Copy link
Contributor

@rawlinp rawlinp commented Aug 12, 2022

Instead of creating a new http influx client with each request, reuse
the existing client. This should prevent connection leaks when an old
client is discarded for a new one but connections are still active on
the old one (and therefore not closed by the Close function).


Which Traffic Control components are affected by this PR?

  • Traffic Stats

What is the best way to verify this PR?

Run Traffic Stats and watch the number of open connections to influxdb. The connection counts should remain steady without climbing indefinitely.

If this is a bugfix, which Traffic Control versions contained the bug?

  • master
  • 7.x
  • 6.x

PR submission checklist

Instead of creating a new http influx client with each request, reuse
the existing client. This should prevent connection leaks when an old
client is discarded for a new one but connections are still active on
the old one (and therefore not closed by the `Close` function).
@rawlinp rawlinp added bug something isn't working as intended Traffic Stats related to Traffic Stats labels Aug 12, 2022
@ocket8888 ocket8888 added the low impact affects only a small portion of a CDN, and cannot itself break one label Aug 15, 2022
@ocket8888 ocket8888 merged commit 38c9096 into apache:master Aug 15, 2022
@rawlinp rawlinp deleted the fix-ts-conn-leak branch August 15, 2022 18:04
zrhoffman pushed a commit to zrhoffman/trafficcontrol that referenced this pull request Oct 2, 2022
Instead of creating a new http influx client with each request, reuse
the existing client. This should prevent connection leaks when an old
client is discarded for a new one but connections are still active on
the old one (and therefore not closed by the `Close` function).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended low impact affects only a small portion of a CDN, and cannot itself break one Traffic Stats related to Traffic Stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants