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: potential body error race #687

Merged
merged 1 commit into from
Dec 22, 2024
Merged

fix: potential body error race #687

merged 1 commit into from
Dec 22, 2024

Conversation

danielgtaylor
Copy link
Owner

This attempts to fix a hard-to-repro race condition when returning an error due to marshaling that includes a reference to the body bytes that will get returned to the pool for re-use before the output is done. The fix here is to cast the bytes to a string, which creates a copy that is safe to reference later.

Fixes #685.

@Copilot Copilot bot review requested due to automatic review settings December 22, 2024 17:52

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Copy link

codecov bot commented Dec 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.77%. Comparing base (5c03160) to head (1182cc1).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #687   +/-   ##
=======================================
  Coverage   92.77%   92.77%           
=======================================
  Files          22       22           
  Lines        4915     4915           
=======================================
  Hits         4560     4560           
  Misses        308      308           
  Partials       47       47           

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

@danielgtaylor danielgtaylor merged commit 44aab0b into main Dec 22, 2024
7 checks passed
@danielgtaylor danielgtaylor deleted the fix-body-error-race branch December 22, 2024 18:00
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.

Race condition detected
1 participant