Coder Social home page Coder Social logo

Values received out-of-order in a single-threaded async single-producer single-consumer scenario (involving tokio::select). about flume HOT 6 CLOSED

zesterer avatar zesterer commented on August 15, 2024
Values received out-of-order in a single-threaded async single-producer single-consumer scenario (involving tokio::select).

from flume.

Comments (6)

rzheka avatar rzheka commented on August 15, 2024 2

No problem, will open a PR.

from flume.

rzheka avatar rzheka commented on August 15, 2024

After some debugging, I see that the following path in Shared<T>::send() is taken occasionally:

chan.queue.push_front(m);

Was the intention really to push_front() here (as opposed to push_back())?

from flume.

Restioson avatar Restioson commented on August 15, 2024

Worth looking into - note that it uses front again at L468

from flume.

zesterer avatar zesterer commented on August 15, 2024

@rzheka Did you have the time to fork, switch to push_back, and confirm whether this continues to happen or not?

from flume.

rzheka avatar rzheka commented on August 15, 2024

With push_back this doesn't happen, my test works fine (I didn't prepare any PR yet, just investigated and played with it on local repo).
The question, though, is whether this push_front was intentional, or it's just a typo?

from flume.

zesterer avatar zesterer commented on August 15, 2024

The question, though, is whether this push_front was intentional, or it's just a typo?

I suspect that it was a typo. The async code paths are not so well tested, and I believe one (and perhaps both) of these cases are not hit without async code being enabled, and the tests probably don't check for ordering in the cases where they are.

Is there any chance you could open a PR with this change?

from flume.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.