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

PartitionConsumer::stream should not block while there are no records #986

Closed
nicholastmosher opened this issue Apr 21, 2021 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@nicholastmosher
Copy link
Contributor

If I create a new empty topic and run the following code, it will block indefinitely:

let consumer = fluvio::consumer("my-topic", 0).await?;

// This call blocks until a record appears in the partition
let mut stream = consumer.stream(Offset::beginning()).await?;

This is not desirable. The expected behavior would be for the stream object to be returned as soon as a connection to the partition leader is created. Waiting should only happen if we explicitly await on fetching elements on the stream, e.g. here:

while let Some(Ok(record)) = stream.next().await { ... }
@nicholastmosher nicholastmosher added bug Something isn't working Client consumer labels Apr 26, 2021
@nacardin nacardin added this to the 0.9.1 milestone Aug 4, 2021
@sehz sehz self-assigned this Aug 4, 2021
@sehz sehz modified the milestones: 0.9.1, 0.9.3 Aug 6, 2021
@sehz sehz modified the milestones: 0.9.3, 0.9.4 Aug 18, 2021
@sehz sehz assigned morenol and unassigned sehz and morenol Aug 18, 2021
@sehz sehz modified the milestones: 0.9.4, 0.9.3 Aug 18, 2021
@bors bors bot closed this as completed in fd43b19 Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants