Repository navigation
Release video temporary files before returning pipeline slots (1.0.3) - #259
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SemVer: patch
When a video is rejected after download/mux, its private files currently survive until the whole sender closes. The same sender can then wait on Reddit or database work while other senders enter the two-slot video pipeline. The pipeline limit therefore does not bound accumulated temporary files and their file cache.
Clean the private directory in send_video's finally block before returning the pipeline slot, covering successful sends, oversized rejections, and upload exceptions. Sender close keeps an idempotent cleanup fallback even if its event loop is already closed. No candidate or destination changes are required.
Validation: a regression reproduces 1,224 MiB of logical leftover files from 12 rejected candidates on the previous code using sparse fixtures; it now leaves no files while all senders remain alive. All 58 offline tests pass, including the 49 MiB real multipart test and interrupted-upload cleanup. All nine live resource tests pass on @r_channels_test using production's actual private-directory lifecycle. The video test confirms local upload files are already gone, downloads the delivered file back from Telegram, and verifies both audio and video tracks with ffprobe. Release validation reports 1.0.3, and the diff passes whitespace checks.
This closes a file-cache growth path found during the production memory verification. The final version will continue through sustained production observation against the 500 MB normal / 1 GB whole-service spike targets.