Repository navigation
test(fast_io): IOCP partial-write integration under memory pressure (#1931) - #4234
Merged
Merged
Conversation
…1931) Adds a Windows-only integration test that drives the IOCP writer and batched disk writer with a small `buffer_size` and shallow `concurrent_ops` so multi-megabyte payloads must be issued as many overlapped submissions with multiple completion-port drain cycles per flush. This models the shape that surfaces partial completions on memory-constrained Windows hosts and verifies the writer accumulates every byte across resubmissions. Covers five scenarios: - `IocpDiskBatch` 16 MiB payload through 4 KiB buffer with 2-op queue - `IocpWriter` 16 MiB payload through 8 KiB buffer with implicit flushes - `IocpWriter` single `write_all` of a non-buffer-multiple length forced to split across many internal chunks - error path: write/commit against a batch with no active file returns `InvalidInput` - error path: `begin_file` against a read-only handle propagates the underlying `ReOpenFile` failure rather than silently succeeding Gated by `#![cfg(all(target_os = "windows", feature = "iocp"))]` so the file compiles to nothing on Linux and macOS. No new dev-dependencies.
oferchen
force-pushed
the
test/iocp-partial-write-1931
branch
from
May 17, 2026 19:53
f4b92cd to
a7aaa9a
Compare
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…1931) (#4234) * test(fast_io): IOCP partial-write integration under memory pressure (#1931) Adds a Windows-only integration test that drives the IOCP writer and batched disk writer with a small `buffer_size` and shallow `concurrent_ops` so multi-megabyte payloads must be issued as many overlapped submissions with multiple completion-port drain cycles per flush. This models the shape that surfaces partial completions on memory-constrained Windows hosts and verifies the writer accumulates every byte across resubmissions. Covers five scenarios: - `IocpDiskBatch` 16 MiB payload through 4 KiB buffer with 2-op queue - `IocpWriter` 16 MiB payload through 8 KiB buffer with implicit flushes - `IocpWriter` single `write_all` of a non-buffer-multiple length forced to split across many internal chunks - error path: write/commit against a batch with no active file returns `InvalidInput` - error path: `begin_file` against a read-only handle propagates the underlying `ReOpenFile` failure rather than silently succeeding Gated by `#![cfg(all(target_os = "windows", feature = "iocp"))]` so the file compiles to nothing on Linux and macOS. No new dev-dependencies. * test(fast_io): import FileWriter trait for bytes_written
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…1931) (#4234) * test(fast_io): IOCP partial-write integration under memory pressure (#1931) Adds a Windows-only integration test that drives the IOCP writer and batched disk writer with a small `buffer_size` and shallow `concurrent_ops` so multi-megabyte payloads must be issued as many overlapped submissions with multiple completion-port drain cycles per flush. This models the shape that surfaces partial completions on memory-constrained Windows hosts and verifies the writer accumulates every byte across resubmissions. Covers five scenarios: - `IocpDiskBatch` 16 MiB payload through 4 KiB buffer with 2-op queue - `IocpWriter` 16 MiB payload through 8 KiB buffer with implicit flushes - `IocpWriter` single `write_all` of a non-buffer-multiple length forced to split across many internal chunks - error path: write/commit against a batch with no active file returns `InvalidInput` - error path: `begin_file` against a read-only handle propagates the underlying `ReOpenFile` failure rather than silently succeeding Gated by `#![cfg(all(target_os = "windows", feature = "iocp"))]` so the file compiles to nothing on Linux and macOS. No new dev-dependencies. * test(fast_io): import FileWriter trait for bytes_written
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…1931) (#4234) * test(fast_io): IOCP partial-write integration under memory pressure (#1931) Adds a Windows-only integration test that drives the IOCP writer and batched disk writer with a small `buffer_size` and shallow `concurrent_ops` so multi-megabyte payloads must be issued as many overlapped submissions with multiple completion-port drain cycles per flush. This models the shape that surfaces partial completions on memory-constrained Windows hosts and verifies the writer accumulates every byte across resubmissions. Covers five scenarios: - `IocpDiskBatch` 16 MiB payload through 4 KiB buffer with 2-op queue - `IocpWriter` 16 MiB payload through 8 KiB buffer with implicit flushes - `IocpWriter` single `write_all` of a non-buffer-multiple length forced to split across many internal chunks - error path: write/commit against a batch with no active file returns `InvalidInput` - error path: `begin_file` against a read-only handle propagates the underlying `ReOpenFile` failure rather than silently succeeding Gated by `#![cfg(all(target_os = "windows", feature = "iocp"))]` so the file compiles to nothing on Linux and macOS. No new dev-dependencies. * test(fast_io): import FileWriter trait for bytes_written
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
crates/fast_io/tests/iocp_partial_write_integration.rs) that drivesIocpDiskBatchandIocpWriterwith a smallbuffer_sizeand shallowconcurrent_opsso multi-megabyte payloads are issued as many overlapped submissions with multiple completion-port drain cycles per flush. This models the shape that surfaces partialWriteFilecompletions on memory-constrained Windows hosts and verifies the writers accumulate every byte across resubmissions.#![cfg(all(target_os = "windows", feature = "iocp"))]so the file compiles to nothing on Linux and macOS. No changes toCargo.toml; only existing dev-dependencies (tempfile,windows-sys) are used.Scenarios covered
IocpDiskBatch: 16 MiB payload through a 4 KiB buffer withconcurrent_ops = 2, fed in 64 KiB slabs - exercisessubmit_write_batchresubmission logic andGetQueuedCompletionStatusExdrain cycles.IocpWriter: 16 MiB payload through an 8 KiB buffer with sub-buffer slabs - exercises the implicitflush_bufferpath in<IocpWriter as Write>::write.IocpWriter: singlewrite_allof1_500_001bytes (non-multiple of buffer size) forced to split across many internal chunks - models "one logical write reports a partial completion split across multiple CQEs".write_data/commit_fileagainst a batch with no active file returnsio::ErrorKind::InvalidInput.begin_fileagainst a read-only handle propagates the underlyingReOpenFilefailure rather than silently succeeding.Each test short-circuits via
is_iocp_available()so the suite stays green on Windows hosts where the probe fails.Test plan
fmt+clippypasses (cargo fmt --all -- --checkis clean locally).