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

otlp: Clients to close body uniformly #5954

Merged

Conversation

mark-pictor-csec
Copy link
Contributor

There were inconsistencies in closing the response body. For traces, the Close happened in a defer statement and any error was logged. Logs and metrics were less rigorous. It appeared Close() wasn't always called, and when it was, errors were returned sometimes and ignored at other times.

This applies the defer logic from traces to the other two and removes other Close() calls.

This was part of PR #5929, and has been split out as requested.

There were inconsistencies in closing the response body. For traces, the
Close happened in a defer statement and any error was logged. Logs and
metrics were less rigorous. It appeared Close() wasn't always called,
and when it was, errors were returned sometimes and ignored at other
times.

This applies the defer logic from traces to the other two and removes
other Close() calls.
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.6%. Comparing base (ac5caea) to head (bb09ba1).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #5954   +/-   ##
=====================================
  Coverage   84.6%   84.6%           
=====================================
  Files        272     272           
  Lines      22896   22897    +1     
=====================================
+ Hits       19389   19390    +1     
  Misses      3163    3163           
  Partials     344     344           

see 4 files with indirect coverage changes

@dmathieu
Copy link
Member

dmathieu commented Nov 8, 2024

Could you add a changelog entry? (the check wasn't failing, but it appears that's because your branch was a bit far behind main).

@mark-pictor-csec
Copy link
Contributor Author

Could you add a changelog entry? (the check wasn't failing, but it appears that's because your branch was a bit far behind main).

I added it under Fixed - I assume that's where it belongs.

CHANGELOG.md Show resolved Hide resolved
@pellared pellared changed the title log, metric, trace clients: close body uniformly otlp: clients to close body uniformly Nov 12, 2024
@pellared pellared changed the title otlp: clients to close body uniformly otlp: Clients to close body uniformly Nov 12, 2024
@pellared pellared merged commit 0bf9572 into open-telemetry:main Nov 12, 2024
32 checks passed
@pellared
Copy link
Member

@mark-pictor-csec, thanks for your contribution ❤️

@mark-pictor-csec
Copy link
Contributor Author

And thank you all for the massive amount of effort you put in!

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

Successfully merging this pull request may close these issues.

4 participants