Skip to content

fix(resolver): bound resolved package stream#377

Merged
jdx merged 1 commit intomainfrom
codex/bound-resolver-stream
Apr 29, 2026
Merged

fix(resolver): bound resolved package stream#377
jdx merged 1 commit intomainfrom
codex/bound-resolver-stream

Conversation

@jdx
Copy link
Copy Markdown
Contributor

@jdx jdx commented Apr 29, 2026

Summary

  • replace the resolver resolved-package stream with a bounded Tokio channel
  • size the install streaming buffer from the same network concurrency used by fetch workers
  • await stream sends so resolver/fetch overlap applies backpressure instead of growing an unbounded queue
  • move an existing install test module below helper items so current all-targets clippy stays green

Validation

  • cargo check -p aube-resolver -p aube
  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test -p aube-resolver

This PR was generated by Codex.


Note

Medium Risk
Changes async streaming semantics (send().await) between resolver and installer, which can affect throughput and introduce stalls if the receiver isn’t drained as expected. Scope is contained to the streaming resolution/fetch overlap path.

Overview
The resolver’s resolved-package stream is now bounded: Resolver::with_stream uses a fixed default capacity and a new with_stream_capacity constructor, and resolved_tx switches from mpsc::UnboundedSender to mpsc::Sender.

All resolver streaming send call sites now await to apply backpressure instead of accumulating an unbounded queue, and install sizes the stream buffer from the same network concurrency used by tarball fetch workers. A small test-module move keeps --all-targets clippy passing.

Reviewed by Cursor Bugbot for commit 7b20f7b. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

This PR replaces the unbounded mpsc channel used to stream resolved packages from the resolver to the fetch coordinator with a bounded channel sized to fetch_network_concurrency, and converts all three tx.send(...) call sites to tx.send(...).await so a full buffer applies backpressure to the resolver instead of allowing unbounded queue growth. The test module relocation is a cosmetic change to satisfy clippy's --all-targets ordering requirement.

Confidence Score: 5/5

Safe to merge — changes are mechanically correct, the async context is valid, and no logic regressions were identified.

All three send sites are inside async fn resolve / async fn resolve_workspace, so .await is valid. The resolver and fetch coordinator run as separate Tokio tasks, so a full channel correctly suspends the resolver without deadlock. capacity.max(1) guards against a zero-capacity channel. The let _ = tx.send(...).await error-discard pattern is consistent with the previous unbounded implementation and behaves correctly when the receiver is dropped. No functional regressions or new bugs found.

No files require special attention.

Important Files Changed

Filename Overview
crates/aube-resolver/src/builder.rs Replaces unbounded channel with a bounded mpsc channel; adds with_stream_capacity and a DEFAULT_STREAM_CAPACITY = 64 fallback for the plain with_stream entry-point.
crates/aube-resolver/src/lib.rs Narrows field type from mpsc::UnboundedSender to mpsc::Sender to match the new bounded channel.
crates/aube-resolver/src/resolve.rs Converts all three tx.send(...) call sites to tx.send(...).await inside already-async resolve/resolve_workspace functions; errors are still silently discarded with let _ = ... as before.
crates/aube/src/commands/install/mod.rs Moves fetch_network_concurrency computation above channel creation so the same value sizes the bounded buffer and the download semaphore; switches to with_stream_capacity; relocates the test module to after all helper functions.

Reviews (1): Last reviewed commit: "fix(resolver): bound resolved package st..." | Re-trigger Greptile

@jdx jdx merged commit a179f9b into main Apr 29, 2026
19 checks passed
@jdx jdx deleted the codex/bound-resolver-stream branch April 29, 2026 13:48
@greptile-apps greptile-apps Bot mentioned this pull request Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant