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 chunked transfer encoding in InfluxDB output #3307

Merged
merged 2 commits into from
Oct 5, 2017

Conversation

danielnelson
Copy link
Contributor

Remove the Content-Length header from all POSTs to InfluxDB.

With the current metrics.Reader the content length cannot be determined without buffering the full request body. Our choice to fix this issue then are:

  • Replace metrics.Reader with a static length serializer regardless of buffer size.
  • Buffer the full request to get the actual size.
  • Remove the Content-Length header and use chunked transfer encoding.

The later was the quickest and least risk, so I went with that for now. In the future, I think we should replace the metrics.Reader with a more appropriate abstraction, as it doesn't allow for the line based structure of line protocol very well.

closes #2854

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated. N/A
  • Has appropriate unit tests.

With the current streaming implementation we cannot correctly determine
the size of the output unless we were to buffer the output fully,
because the actual size depending on if any splitting is performed.
@danielnelson danielnelson added the fix pr to fix corresponding bug label Oct 5, 2017
@danielnelson danielnelson added this to the 1.4.2 milestone Oct 5, 2017
@danielnelson danielnelson merged commit cce40c5 into master Oct 5, 2017
@danielnelson danielnelson deleted the influxdb-http-disable-content-length branch October 5, 2017 23:14
danielnelson added a commit that referenced this pull request Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metric corruption when using http2 nginx reverse proxy with influxdb output
1 participant