Repository navigation
obs-util: Bound os_get_free_disk_space so a hung share can't stall obs-websocket - #2341
Merged
Merged
Conversation
todo!() stub for BoundedFreeSpace and its Tier 1 cases: a hung volume answers 0 or its last value within the deadline, calls while a query hangs start no new query, a recovered volume answers fresh values, and paths don't block each other. Refs #1345
Each path has at most one statvfs/GetDiskFreeSpaceEx in flight on a helper thread. A call waits up to 200 ms, then answers the path's last value (0 before the first). A hung share now costs one helper thread per path instead of one obs-websocket pool thread per GetStats request, so the pool never fills. The Linux, macOS and Windows exports route through it; a failed thread spawn falls back to the direct query. Fixes #1345
zackees
marked this pull request as ready for review
October 25, 2026 04:30
zackees
enabled auto-merge
October 25, 2026 04:42
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.
Fixes #1345
os_get_free_disk_space()runsstatvfsorGetDiskFreeSpaceExwith no bound. obs-websocket'sGetStatscalls it once per request on aQThreadPoolthread. So on a hung network share, a client polling every second fills the pool, and every request and event stops.The plugin stays unchanged, per AGENTS.md. The fix is in Rust OBS: the export now comes from
obs_util::bounded_free_space.record-disk-space.h).These are the defaults proposed on #1345. Neither "Decision needed" item has been answered, so they are easy to change.
Tests
obs-util: Test a deadline…):rust/obs-util/tests/platform/bounded_free_space.rs, in the existingplatformcategory of the suite, so no new test binary. All six cases fail against thetodo!()stub:./lintis clean.test_record_disk_spaceuses an injected function.The features ledger line is added.