Skip to content

runtime: expose Builder::rng_seed without tokio_unstable#8

Open
antsujay wants to merge 1 commit intoanthropics:anthropic-1.49.0from
antsujay:rng-seed-stable-v1.49.0
Open

runtime: expose Builder::rng_seed without tokio_unstable#8
antsujay wants to merge 1 commit intoanthropics:anthropic-1.49.0from
antsujay:rng-seed-stable-v1.49.0

Conversation

@antsujay
Copy link
Copy Markdown
Collaborator

@antsujay antsujay commented Apr 15, 2026

Moves Builder::rng_seed, the runtime::RngSeed re-export, and RngSeed::from_bytes out of cfg_unstable! so callers can seed the scheduler RNG (deterministic select! branch ordering) without --cfg tokio_unstable.

The underlying seed_generator field and all runtime plumbing were already unconditional; only the public setter and type re-export were gated. No behavior change for builds that already set tokio_unstable.

Tested:

  • cargo check -p tokio --features full (without tokio_unstable)
  • cargo check -p tokio --features full with RUSTFLAGS="--cfg tokio_unstable"
  • cargo test -p tokio --doc --features full rng_seed (doc example compiles and runs without the cfg)

Upstream tracking issue: tokio-rs#4879 (introduced in tokio-rs#4910).

Version bumped to 1.49.0+anthropic.2.

Moves `Builder::rng_seed`, the `runtime::RngSeed` re-export, and
`RngSeed::from_bytes` out of `cfg_unstable!` so callers can seed the
scheduler RNG (and thus get deterministic `select!` branch ordering)
without `--cfg tokio_unstable`.

The underlying `seed_generator` field and all runtime plumbing were
already unconditional; only the public setter and type re-export were
gated. No behavior change for builds that already set `tokio_unstable`.

Upstream tracking issue: tokio-rs#4879 (introduced in tokio-rs#4910).
@antsujay antsujay force-pushed the rng-seed-stable-v1.49.0 branch from 947da41 to 64c734e Compare April 16, 2026 00:08
@antsujay antsujay requested a review from njsmith April 16, 2026 00:33
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