fix(dgw): use statvfs for recording storage space on Unix#1730
Merged
Benoît Cortier (CBenoit) merged 4 commits intomasterfrom Mar 27, 2026
Merged
fix(dgw): use statvfs for recording storage space on Unix#1730Benoît Cortier (CBenoit) merged 4 commits intomasterfrom
Benoît Cortier (CBenoit) merged 4 commits intomasterfrom
Conversation
Replaces the sysinfo disk-enumeration approach on Linux/macOS with a direct statvfs(2) call against the configured recording path. This fixes incorrect or missing space values for network filesystems (NFS, CIFS/Samba) and any mount point the previous heuristic could not resolve. Issue: DGW-355
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Mar 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Devolutions Gateway’s heartbeat recording-storage metrics on Linux/macOS by querying filesystem capacity directly for the configured recording path, improving correctness on network filesystems and hard-to-resolve mount layouts (DGW-355).
Changes:
- Replaced Unix disk-space detection with a direct
statvfs(2)call against the recording path. - Removed
sysinfo/duncedependencies previously used for disk enumeration/canonicalization heuristics. - Updated heartbeat tests to reflect supported vs unsupported platforms for space metrics.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| devolutions-gateway/src/main.rs | Removes force-link imports for sysinfo/dunce after switching away from those dependencies. |
| devolutions-gateway/src/api/heartbeat.rs | Implements Unix statvfs-based disk-space query for the recording path and adjusts platform expectations in tests/docs. |
| devolutions-gateway/Cargo.toml | Drops sysinfo/dunce and adds Unix-only libc dependency for statvfs. |
| Cargo.lock | Lockfile updates reflecting dependency changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Replaces the sysinfo disk-enumeration approach on Linux/macOS with a direct statvfs(2) call against the configured recording path. This fixes incorrect or missing space values for network filesystems (NFS, CIFS/Samba) and any mount point the previous heuristic could not resolve.
Issue: DGW-355