Repository navigation
fix(sort): resolve --max-temp-files once and bake it into the chain spec - #891
Conversation
build_sort_chain_spec previously left SortOptions.max_temp_files as the raw MaxTempFiles::Auto/Fixed setting, so the chain builder re-resolved it from its own RLIMIT_NOFILE snapshot independently of the one already taken for the startup banner. The two snapshots could disagree. Resolve it once in execute_sort and bake the resolved usize into SortOptions as MaxTempFiles::Fixed before building the spec, so the banner and the chain always agree on the same resolution.
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. WalkthroughThe sort command now resolves the maximum temporary-file count once and passes it into the chain specification as a fixed value. Tests verify the generated options while preserving the command’s ChangesSort temporary-file limit resolution
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change resolves the temporary-file limit once and uses that fixed value consistently when building the sort chain, preserving output behavior; no actionable merge-blocking risk remains after normal checks and review. Suggested labels: 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
Comment |
|
@coderabbitai pause |
|
@coderabbitai review |
✅ Action performedReviews paused. |
✅ Action performedReview finished.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #891 +/- ##
==========================================
- Coverage 92.96% 92.96% -0.01%
==========================================
Files 299 299
Lines 150342 150345 +3
==========================================
Hits 139769 139769
- Misses 10573 10576 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What
Resolves
fgumi sort --max-temp-filesonce and bakes the result into the chain spec, instead of resolvingAutotwice from two independentRLIMIT_NOFILEsnapshots.Before this change,
execute_sortresolved--max-temp-files Autofor the startup banner (self.resolved_max_temp_files(soft_nofile)), whilebuild_sort_chain_specbaked the rawMaxTempFiles::AutointoSortOptions— so the chain builder re-resolved it against a second, independentRLIMIT_NOFILEsnapshot. The two snapshots agree in practice (the descriptor limit is stable within a process), but they are logically independent.build_sort_chain_specnow takes aresolved_max_temp_files: usizeand bakesSortOptions.max_temp_files = MaxTempFiles::Fixed(resolved).execute_sortpasses the value it already computed for the banner, so the banner and the chain share a single resolution. The chain builder's ownAutobranch is unchanged (other callers keep it);sortnow always hands it aFixedvalue.The banner's
auto → Nframing is intentionally unchanged (it still receives the rawself.max_temp_filesfor framing plus the resolved number).Correctness
test_sort_cutover_parity) passes byte-identical (19/19, all four sort orders) against the saved pre-cutover baseline binary, confirming the baked-Fixedvalue matches what the builder resolved before.--max-temp-files auto, the built spec carriesMaxTempFiles::Fixed(resolved), notAuto— proving the chain is handed a single resolution.unsafe. Full gate green (fmt, clippy-D warnings -W pedantic, doc-D warnings, test suite).Addresses a CodeRabbit finding raised on #890.
Risk: command output changes: none, pinned by the cutover parity suite;
unsafechanges: none, so theCLAUDE.mdallowlist is unchanged; memory, queue, thread, and backpressure policy changes: none.Fix: Resolve
Autoonce inexecute_sortand store the result asMaxTempFiles::Fixed. The startup banner and chain builder now use the sameRLIMIT_NOFILEsnapshot.Tests verify the resolved value in the chain specification. Formatting, linting, documentation, and test gates pass.