Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation stuck while resolving futures_async_stream #103147

Closed
xxchan opened this issue Oct 17, 2022 · 4 comments
Closed

compilation stuck while resolving futures_async_stream #103147

xxchan opened this issue Oct 17, 2022 · 4 comments
Labels
C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression.

Comments

@xxchan
Copy link
Contributor

xxchan commented Oct 17, 2022

Code

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::mir::ConstantKind>: result=Ok(Val(ZeroSized, for<'a, 'b, 'c> fn(std::pin::Pin<&'a mut futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:760:5: 760:61]>>, &'b mut std::task::Context<'c>) -> std::task::Poll<std::option::Option<<futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:760:5: 760:61]> as tokio_stream::Stream>::Item>> {<futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:760:5: 760:61]> as tokio_stream::Stream>::poll_next})) with 4052 obligations
INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::subst::GenericArg>: result=Ok(unsafe fn(&mut futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:760:5: 760:61]>) -> std::pin::Pin<&mut futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:760:5: 760:61]>> {std::pin::Pin::<&mut futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:760:5: 760:61]>>::new_unchecked}) with 4052 obligations
INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::mir::ConstantKind>: result=Ok(Val(ZeroSized, unsafe fn(&mut futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:760:5: 760:61]>) -> std::pin::Pin<&mut futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:760:5: 760:61]>> {std::pin::Pin::<&mut futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:760:5: 760:61]>>::new_unchecked})) with 4052 obligations

It seems that Rust is very slow with resolving futures_async_stream. It took about 1sec for each resolving. As a comparison, previous builds only have 0 obligations for all these things.

Originally posted by @skyzh in risingwavelabs/risingwave#5119 (comment)

And we have located the problem occurs on this function: https://github.com/risingwavelabs/risingwave/blob/2c5bc306cb063376e3497bc27f14f80ed15a6a97/src/stream/src/executor/hash_join.rs#L604-L605

After removing the #[for_await] in the function body, it will compiles quickly.

I expected to see this happen: it compiles.

Instead, this happened: it got stuck.

Version it worked on

It most recently worked on: nightly-2022-07-29

Version with regression

rustc --version --verbose:

rustc 1.66.0-nightly (b8c35ca26 2022-10-15)
binary: rustc
commit-hash: b8c35ca26b191bb9a9ac669a4b3f4d3d52d97fb1
commit-date: 2022-10-15
host: aarch64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2

Backtrace

Backtrace

<backtrace>

@xxchan xxchan added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Oct 17, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Oct 17, 2022
@skyzh
Copy link
Contributor

skyzh commented Oct 17, 2022

Probably I'll get some easy-to-reproduce examples...

@skyzh
Copy link
Contributor

skyzh commented Oct 18, 2022

The difference:

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::subst::GenericArg>: result=Ok(fn(futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:604:5: 604:61]>) -> std::pin::Pin<std::boxed::Box<dyn tokio_stream::Stream<Item = <futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:604:5: 604:61]> as tokio_stream::Stream>::Item> + std::marker::Send>> {<futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:604:5: 604:61]> as futures::StreamExt>::boxed::<'_>}) with 4052 obligations

where in nightly-07-29

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::subst::GenericArg>: result=Ok(fn(futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:604:5: 604:61]>) -> std::pin::Pin<std::boxed::Box<dyn tokio_stream::Stream<Item = <futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:604:5: 604:61]> as tokio_stream::Stream>::Item> + std::marker::Send>> {<futures_async_stream::try_stream::from_generator::GenTryStream<[static generator@src/stream/src/executor/hash_join.rs:604:5: 604:61]> as futures::StreamExt>::boxed}) with 0 obligations

Note that the latest nightly has an extra ::<'_> after boxed. Not sure if this is the contributing factor of so many obligations... still working on a minimum reproducible example.

@skyzh
Copy link
Contributor

skyzh commented Oct 18, 2022

Not related to futures_async_stream. Need investigate where are the 4000+ obligations from. cc @xxchan let's close for now until we find the root cause and submit another issue?

@skyzh
Copy link
Contributor

skyzh commented Oct 18, 2022

Probably has fixed by #102945? Let's try again. Nope 🤣

@xxchan xxchan closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2022
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression.
Projects
None yet
Development

No branches or pull requests

4 participants