Fix: Remove redundant enabled checks in HLS/DASH cleanup to prevent resource leaks. v6.0.173 v7.0.54#4161
Merged
winlinvip merged 5 commits intoossrs:developfrom Aug 14, 2025
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
+1 I reach here for the same issue, some timeline to fix this? or merge this changes? |
|
hi, how long to release this fix? I'm having this problem and it's causing disk space overflow. |
195435d to
97e2b64
Compare
winlinvip
approved these changes
Aug 14, 2025
winlinvip
added a commit
that referenced
this pull request
Aug 14, 2025
…esource leaks. v6.0.173 (#4161) HLS and DASH components had redundant `enabled` flag checks in their `cycle()` and `cleanup_delay()` methods that prevented proper cleanup of files when components were disabled. This created a race condition where: 1. Stream stops publishing and HLS/DASH components get disabled 2. `cycle()` returns early without performing disposal operations 3. `cleanup_delay()` returns 0 instead of configured disposal timeout 4. Source cleanup doesn't wait long enough for file disposal 5. HLS/DASH files remain on disk without proper cleanup The `enabled` flag should control processing of **new incoming streams**, but should NOT prevent **cleanup of existing files** from previously enabled streams. Remove redundant `enabled` checks from: - `SrsHls::cycle()` and `SrsDash::cycle()` - Allow disposal logic to run even when disabled - `SrsHls::cleanup_delay()` and `SrsDash::cleanup_delay()` - Always return proper disposal timeout --------- Co-authored-by: winlin <winlinvip@gmail.com>
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.
Problem
HLS and DASH components had redundant
enabledflag checks in theircycle()andcleanup_delay()methods that prevented proper cleanup of files when components were disabled. This created a race condition where:cycle()returns early without performing disposal operationscleanup_delay()returns 0 instead of configured disposal timeoutRoot Cause
The
enabledflag should control processing of new incoming streams, but should NOT prevent cleanup of existing files from previously enabled streams.Solution
Remove redundant
enabledchecks from:SrsHls::cycle()andSrsDash::cycle()- Allow disposal logic to run even when disabledSrsHls::cleanup_delay()andSrsDash::cleanup_delay()- Always return proper disposal timeout