Repository navigation
fix(gateway): gate file-region adaptation on Unix - #1622
Merged
Merged
Conversation
Co-Authored-By: heihutu <[email protected]> Co-Authored-By: zhi22915 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the platform-specific response adaptation change.
No open issues 🎉
What changed in this PR
Fixes Windows consumer builds by keeping Unix-only file-region adaptation out of the gateway’s portable response path.
Changes:
- Gates file-copy helpers and related imports on Unix.
- Returns responses unchanged on non-Unix platforms.
- Adds a test verifying that ordinary responses retain their status and body bytes.
| File | Description |
|---|---|
crates/gateway/src/file_fallback.rs |
Adds platform-specific adaptation and a response-preservation test. |
Review effort: Balanced
Co-Authored-By: heihutu <[email protected]> Co-Authored-By: zhi22915 <[email protected]>
Co-Authored-By: heihutu <[email protected]> Co-Authored-By: zhi22915 <[email protected]>
Co-Authored-By: heihutu <[email protected]> Co-Authored-By: zhi22915 <[email protected]>
Co-Authored-By: heihutu <[email protected]> Co-Authored-By: zhi22915 <[email protected]>
RamakrishnaChilaka
added a commit
to RamakrishnaChilaka/rustfs
that referenced
this pull request
Nov 19, 2026
…k cfg Pulls in rustfs/gateway#1622 (d32f17219d75989167a05183dd3d04922615cbd5) which gates Unix-only file-region adaptation in rustfs-gateway so Windows Startup Smoke compiles cleanly.
overtrue
pushed a commit
to rustfs/rustfs
that referenced
this pull request
Nov 19, 2026
…9498) * perf(ecstore): trim redundant syscalls in multipart part preparation Use io_get_object_open_path in the advisory clean-source cache probe, reuse validated part-path prefixes when constructing MultipartSourceAdmission in prepare_part_transaction, and create new.meta before snapshotting absent old-part markers so old.data.absent and old.meta.absent share new.meta's inode via linkat. * test(ecstore): guard marker inode identity check on hardlink support Probe hardlink support in the test fixture before asserting that old.data.absent and old.meta.absent share new.meta's inode, and assert empty fallback markers when hardlinking is unsupported. * chore(storage): remove unused test helper PostObjectFormPolicy::with_metadata Commit 5e55549 removed the last caller in rustfs/src/storage/access.rs, leaving with_metadata unused under #[cfg(test)]. * fix(rustfs): align control-plane speedtest, rebalance logging, and admin/auth tests Register streaming PostV3SpeedtestClientDevnull on the gateway control-plane host, log error diagnostics on corrupt rebalance metadata loads, avoid 43-char OIDC parent key collisions in s3_extension_tests, align AddUser gate test with 88b90c1, and split auth.rs at mod tests. * chore(deps): bump rustfs-gateway to d32f1721 for Windows file-fallback cfg Pulls in rustfs/gateway#1622 (d32f17219d75989167a05183dd3d04922615cbd5) which gates Unix-only file-region adaptation in rustfs-gateway so Windows Startup Smoke compiles cleanly. --------- Co-authored-by: Hauser Zhi <[email protected]>
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.
Summary
The response adapter calls Unix-only file-region methods from its portable entry point. Windows builds of consumers such as rustfs/rustfs#9521 fail with two E0599 errors. Keep the file-copy implementation on Unix and return the existing response directly on platforms where
Bodyhas no file-region variant.Refs rustfs/rustfs#9517 and rustfs/rustfs#9521.
The CI follow-up registers suites already present in the Gateway and HTTP integration targets, trims redundant service and rendering documentation to meet the existing file limits while keeping the guarded code and tests in their original locations, and updates the test-only ZIP dependency to 9.0.5. The response stamper transfers the formatted Date buffer to the header, keeping the warm request allocation budget intact.
Verification
Cross-checked the library with
cargo +stable check --locked -p rustfs-gateway --no-default-features --target x86_64-pc-windows-msvc --lib. The base raised both E0599 errors, and the fixed library compiled.All three
file_fallback::testspassed. Replacing the ordinary response with an empty response made the new assertion fail with a 200 and empty body where it expects the original 206 and bytes.The initial Windows revision reproduced the upstream GetObject allocation failure at 105 blocks against a ceiling of 104. The CI follow-up passes the existing allocation test with 104.0 blocks per GetObject and 109.01 per PutObject with the existing half-block tolerance. Upstream baseline
With Rust 1.97.1 on Linux, formatting, workspace Clippy with
-D warnings, workspace tests, andcargo xtask verify --crate rustfs-gatewaypassed. The consolidation and target-coverage mutation suites passed 116 and 32 cases respectively. The file-size, module-documentation, handler-deadline and response-encoding guards also passed on the final layout. The configuration snapshot guard passed its positive controls and rejected a second allowlisted load.The workspace dependency policy and AWS SDK Rust driver advisory checks pass. The policy allows RUSTSEC-2026-0543 because the pinned S3 compatibility baselines require chrono and the maintenance advisory has no patched release. RustSec advisory
Role Verdicts
Breaking Change
Checklist
cargo xtask verify)unsafeintroducedinventory/linkmeintroduced#[non_exhaustive]added to a DTO