-
Notifications
You must be signed in to change notification settings - Fork 108
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
Buffered-stream goes over capacity when put! and try-put! don't respect backpressure #110
Comments
And maybe this is a related, but different issue https://gist.github.com/jeroenvandijk/a753b5945b6cd1f8fa8811e4c393f974#file-manifold_test-clj-L90 i.e. I think it means |
Hey, sorry for not responding to this sooner. In general, if you don't respect backpressure than things won't work very well in Manifold. You'll notice that even in your examples where it's "respected", there are still a ton of entries under In general, I'd say this is not a bug so much as a quirk in how the description in |
The documentation for
But in the provided example, while the :buffer-capacity is 10, :buffer-size is 100 and :pending-puts is 0. Shouldn't the :buffer-size be 10 and :pending-puts 90 here? |
Well, sort of. As Zach mentions, it's a quirk of how The first thing to understand is that the exceeding your buffer size/limit doesn't mean items are dropped, it just means that the associated Now, the key difference between using This means Regular streams with a buffer-size do something similar, where excess puts just end up on a In both cases, the deferreds return by |
manifold.stream/buffered-stream
allows a bigger buffer-size than what is configured when usings/put!
ors/try-put!
and ignoring backpressure:The same happens with
manifold.stream/try-put!
. I've confirmed thatmanifold.stream/stream
doesn't have this issue.This was observed with
[manifold "0.1.6-alpha1"]
and[org.clojure/clojure "1.8.0"]
and Java 8Here is a complete test file with all these cases https://gist.github.com/jeroenvandijk/a753b5945b6cd1f8fa8811e4c393f974
Note that there is no limit on the buffer-size at all. In production I've seen buffers go over their configured limit times 100.
Thanks to @dm3 for narrowing down this issue.
The text was updated successfully, but these errors were encountered: