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

ai/live: Fix early EOFs in media reader #3314

Merged
merged 1 commit into from
Dec 12, 2024
Merged

ai/live: Fix early EOFs in media reader #3314

merged 1 commit into from
Dec 12, 2024

Conversation

j0sh
Copy link
Collaborator

@j0sh j0sh commented Dec 12, 2024

Sometimes if the reader is slow to pull data (eg, during a retry) and the buffer grows larger than a read then closes, the reader may incorrectly signal EOF and return incomplete data. Don't do that.

The practical consequence here is we would sometime write truncated segments to the server, since the trickle publish is serviced by the segment reader which is being fixed here

Sometimes if the reader is slow to pull data (eg, during a retry)
and the buffer grows larger than a read then closes, the reader
may incorrectly signal EOF and return incomplete data. Don't do that.
@j0sh j0sh requested review from victorges, leszko and mjh1 December 12, 2024 08:16
@github-actions github-actions bot added the go Pull requests that update Go code label Dec 12, 2024
@j0sh j0sh changed the title ai/live: Fix early EOFs ai/live: Fix early EOFs in media reader Dec 12, 2024
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 34.03496%. Comparing base (abd997d) to head (6a68935).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
media/rw.go 0.00000% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3314         +/-   ##
===================================================
- Coverage   34.03772%   34.03496%   -0.00276%     
===================================================
  Files            141         141                 
  Lines          37006       37009          +3     
===================================================
  Hits           12596       12596                 
- Misses         23691       23694          +3     
  Partials         719         719                 
Files with missing lines Coverage Δ
media/rw.go 0.00000% <0.00000%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abd997d...6a68935. Read the comment docs.

Files with missing lines Coverage Δ
media/rw.go 0.00000% <0.00000%> (ø)

@j0sh j0sh merged commit a367c90 into master Dec 12, 2024
20 checks passed
@j0sh j0sh deleted the ja/fix-early-eofs branch December 12, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants