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

Fix bug where the error logged when conversion of data fails is always nil #12510

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Feb 27, 2025

The problem was that in the logging statement (in all signals) we log err instead of cErr. The good part is that this is not a UB, because if we get to the point where that function is called, the err was nil otherwise and never modified again so not race condition in accessing it.

Separate the lambda function in a different function so we don't repeat the same mistake of capturing other params by mistake.

@bogdandrutu bogdandrutu requested review from mx-psi, dmathieu, a team and dmitryax as code owners February 27, 2025 01:30
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 65.90909% with 15 lines in your changes missing coverage. Please review.

Project coverage is 92.11%. Comparing base (216046a) to head (11227c2).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
exporter/exporterhelper/logs.go 45.45% 4 Missing and 2 partials ⚠️
exporter/exporterhelper/metrics.go 72.72% 2 Missing and 1 partial ⚠️
exporter/exporterhelper/traces.go 72.72% 2 Missing and 1 partial ⚠️
...xporter/exporterhelper/xexporterhelper/profiles.go 72.72% 2 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (65.90%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12510      +/-   ##
==========================================
- Coverage   92.16%   92.11%   -0.06%     
==========================================
  Files         465      467       +2     
  Lines       25201    25252      +51     
==========================================
+ Hits        23226    23260      +34     
- Misses       1576     1590      +14     
- Partials      399      402       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bogdandrutu bogdandrutu added this pull request to the merge queue Feb 27, 2025
Merged via the queue into open-telemetry:main with commit 0d81535 Feb 27, 2025
53 of 54 checks passed
@bogdandrutu bogdandrutu deleted the fix-wrong-error-log branch February 27, 2025 04:12
andrzej-stencel added a commit to andrzej-stencel/opentelemetry-collector that referenced this pull request Feb 28, 2025
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.

2 participants