Repository navigation
fix: check disk space on the work directory filesystem - #4846
Open
cfilipescu wants to merge 1 commit into
Open
cfilipescu wants to merge 1 commit into
cfilipescu wants to merge 1 commit into
Conversation
cfilipescu
force-pushed
the
fix/work-directory-disk-space
branch
from
November 9, 2026 18:35
052a4ce to
f036318
Compare
Author
|
@salmanmkc @nikola-jokic @TingluoHuang Any feedback on this PR? I feel like it's an easy review, but it can improve the github-runner on the Fedora IoT system, which is an immutable system. |
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.
On Linux,
Directory.GetDirectoryRoot(workDirectory)returns/, so the low-disk-space warning checks the root filesystem even when the runner's work directory is on another mount. This produces false warnings on immutable/composefs roots and can miss low space on a separate work filesystem.Pass the full work directory to
DriveInfo. .NET's Unix implementation preserves this path and passes it tostatfs/statvfs, so the kernel checks the filesystem backing the directory, including when the path traverses a symlink. No additional native interop is needed.Fixes #4380.
Validation:
cd src && ./dev.sh formatcd src && ./dev.sh test: all 1,165 tests passed on Linux with .NET SDK 8.0.427.CheckDiskSpaceAsyncextracted verbatim from the original and updated source, with a nested work directory on a 16 MiB tmpfs: the original code misses the warning at a 32 MiB threshold; the fix reports 16 MiB available. An 8 MiB threshold produces no warning. Both cases also pass through a symlink to the work directory.