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

nested flatten_unordered hangs #2725

Closed
krallin opened this issue Mar 20, 2023 · 2 comments · Fixed by #2726
Closed

nested flatten_unordered hangs #2725

krallin opened this issue Mar 20, 2023 · 2 comments · Fixed by #2726
Labels
A-stream Area: futures::stream bug

Comments

@krallin
Copy link

krallin commented Mar 20, 2023

I've (also) run into this issue that was reported on users.rust-lang.

I suspect this might be the right forum to contact the maintainers of the futures crate, so here's an issue as well and a cleaned up repro. Namely, this hangs:

#[tokio::main]
async fn main() {
    use futures::future;
    use futures::stream;
    use futures::StreamExt;
    use tokio::time::interval;
    use tokio_stream::wrappers::IntervalStream;

    let inner = IntervalStream::new(interval(std::time::Duration::from_millis(500)))
        .map(|_| stream::once(future::ready("VALUE")))
        .flatten_unordered(None);

    let mut stream = stream::once(future::ready(inner)).flatten_unordered(None);

    while let Some(value) = stream.next().await {
        dbg!(&value);
    }
}

This seems like it should evidently just yield values forever (by creating a new stream-of-1-value every 500ms), but as-is it does not and it just hangs after the first value.

@krallin
Copy link
Author

krallin commented Mar 23, 2023

@olegnn, @taiki-e : quick question: when might we expect a release containing those bugfixes?

@taiki-e
Copy link
Member

taiki-e commented Mar 30, 2023

Published in 0.3.28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stream Area: futures::stream bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants