Skip to content

Subscriber as a Future occasionally skips records (but as an Iterator it does not)  #1313

@rrichardson

Description

@rrichardson
  1. Expected result: That the inserted entries would exactly match the entries output by the Subscriber when poll()'d
  2. The Subscriber, when polled, seems to skip about 1.5% of records (when insertion runs in a tight loop)
  3. Version v0.34.6 - (from crates.io)
  4. Rust rustc 1.51.0 (2fd73fabe 2021-03-23)
  5. OS: Fedora CoreOS
  6. Reproduction: https://github.com/rrichardson/sled_stream/blob/main/src/main.rs
  7. Hmm..
Testing future
Future missed 13 records D:
Testing Iterator
Iterator's all good :)

I have not yet looked at the code, but I think I have an idea of what the problem might be if Iterator works and Future doesn't.. either way, as part of #1311 I am happy to submit a PR that changes the Future to a Stream and fixes this issue.

(Also, it should probably documented that when Subscriber is used as an Iterator, it can block, this is certainly the intended behavior, but it might surprise people.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions