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(otlp-exporter-base): fix unhandled error when writing to destroyed http request #5163

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Nov 15, 2024

Which problem is this PR solving?

See #5101 and #5102 - there's some possibility to run into an unhandled error when piping the data to the request, based on the current state of the request. Since that requires specific timing I was not able to fully reproduce, but there's a way to trigger a similar error at this spot when using the compressAndSend() function directly.

This PR adds an error handler after pipe() to ensure that also errors from this call are properly handled.

Fixes #5101
Supersedes #5102

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added Unit Tests

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.20%. Comparing base (6096f72) to head (ce2f997).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5163      +/-   ##
==========================================
+ Coverage   93.18%   93.20%   +0.01%     
==========================================
  Files         314      314              
  Lines        8076     8077       +1     
  Branches     1622     1622              
==========================================
+ Hits         7526     7528       +2     
+ Misses        550      549       -1     
Files with missing lines Coverage Δ
...ter-base/src/platform/node/http-transport-utils.ts 100.00% <100.00%> (+2.08%) ⬆️

@pichlermarc pichlermarc marked this pull request as ready for review November 15, 2024 20:33
@pichlermarc pichlermarc requested a review from a team as a code owner November 15, 2024 20:33
@pichlermarc pichlermarc added bug Something isn't working priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc pkg:otlp-exporter-base labels Nov 15, 2024
@pichlermarc pichlermarc added this pull request to the merge queue Nov 18, 2024
Merged via the queue into open-telemetry:main with commit 9e4d36c Nov 18, 2024
24 checks passed
@pichlermarc pichlermarc deleted the fix/unhandled-otlp-http-error branch November 18, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:otlp-exporter-base priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible Unhandled 'error' event
2 participants