Skip to content

Release video temporary files before returning pipeline slots (1.0.3) - #259

Merged
Fillll merged 1 commit into
masterfrom
fix/video-attempt-resources
Oct 17, 2026
Merged

Fillll merged 1 commit into
masterfrom
fix/video-attempt-resources

Conversation

@Fillll

@Fillll Fillll commented Oct 17, 2026

Copy link
Copy Markdown
Owner

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.

@Fillll
Fillll merged commit ba83f07 into master Oct 17, 2026
3 checks passed
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