-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Fix to a bunch of bugs and issues with AsyncOnSubscribe #3356
Conversation
It seems to me that there are still outstanding questions as to the AsyncOnSubscribe usage. I am going to open a pull request with improved javadocs for the next function. This should help clear up confusion about it's usage. Also there are a couple items here that I'd like to discuss in greater depth. I am not okay with a complete rewrite (as you have provided here) but I would gladly accept contributions. Please read my comments below and reply so that we can move forward.
Great. Good improvement. I would like to see a pull request for this against the current existing code base.
Is this the
When debugging your previous test it was clear to me that the
Can you be more specific? The Buffer until subscriber uses an unbounded queue and I already commented that this was a known issue. I would accept a pull request to address this issue against the existing code base.
The observables emitted to the observer should emit exactly
I deliberately chose not to validate the quantity of onNexted events. This is like validating at every level when it will invalidate intermittently at runtime and then blow up or if you don't implement validation then a missing back pressure exception is thrown intermittently, and it blows up at runtime. Is there anything better that we can do? I vote to not validate and trust that the user of the AsyncOnSubscribe follows the contract (that we will document in detail). |
First of all, this isn't a complete rewrite as I kept everything else that wasn't contributing to a bug. The API is still the same and the behavior is what looked like you'd like to achieve: client requests of n_i should be responded to with a single Observable that produces n_i values or (less + completes the main sequence).
The fixes apply together, not in parts.
We use this constructor in many other tests that require zero request upfront. It works there. Your code composed the various
I have a version of
You don't seem to understand how Your original code forgot to tell |
@akarnokd I here you. Here is my concern. I have asked you directly for you feedback over the design and I have not received from you what I think is sufficient input to see that we both agree on the design or even the goals. My last impression from you regarding the All of that said, I need confirmation that you and I are trying to achieve the same goals before I consider merging this. |
It seems much of the disagreement between you two is that the design and approach was not well discussed, and instead we have jumped to implementations without a common understanding. That discussion is dangling here: #3003 @akarnokd You need to involve yourself in that discussion where I and @stealthcode have weighed in, but not received further feedback.
It is generally not helpful to start from scratch unless there is upfront agreement that the original should not be pursued or iterated upon. Forking in two directions dilutes the discussion, pits egos against each other, and prevents collaboration. I view this PR as a rewrite. Looking at the two side-by-side shows hardly any code left behind, and the algorithms are changed, and it's hard to tell what is actually because of issues versus just stylistic differences between them. This in turn forces everyone to start from scratch in reading the code, understanding the issues and making decisions. If there is something fundamental about the original code that prevents correct behavior, then I suggest that be discussed up front with the original author.
The underlying contention I sense between you two is shown in places such as: Please communicate with respect for each other. Another example of statement that is not helpful:
@akarnokd I could say very similar things if I wanted to about bugs you wrote into the last revision of I too have submitted PRs with mistakes and bugs. All of us have. We do code reviews and patch releases for a reason, otherwise we should have been done this project a year ago. Stick to objective statements of functionality, performance, and usage. A bug is a bug. A misunderstanding is just that. Overlooking something is easy, particularly when dealing with asynchrony, concurrency, flow control and the like. This particular
Both of you (@akarnokd & @stealthcode) are great engineers, but with different strengths and weaknesses. That is a great thing for the project to have those diverse viewpoints and skills. Please focus more on communication and less on the code for a bit. Code is honestly the easiest part of our job. In the long run, healthy collaboration is far more important that sprinting on code. |
I did my part in reviewing the code and providing fixes. If you think the original version is what you wanted then its up to you and there is no point in discussing this any further. |
I misunderstood your original statement. My mistake. I reviewed the code and it looks fine 👍 |
Fix to a bunch of bugs and issues with AsyncOnSubscribe
There were several problems with the operator:
Long.MAX_VALUE
no matter what the child requested.Observable
s.Observable
s and the main concatenation could overflow the internal buffers and had to be defensively-buffered.Observable
that delivered less than this requested amount, the child ended up hanging.MissingBackpressureException
or hangs.generateState
is now delivered to the child immediately.As I see, the usage is as follows. Each individual
request()
from the child is supposed to be fulfilled by individualObservable
s. For example,request(1)
andrequest(5)
will generate two distinctObservable
s where the first will have 1 value and the second 5.