-
Notifications
You must be signed in to change notification settings - Fork 184
Reinstantiate backpressure propagation to NettyInbound #231
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
Comments
Well it's not like backend will stop message producing if we propagate it to NettyInbound, so why should we care? |
Not reading messages from the channel leaves the messages in the receive buffers. If these buffers are full, then the sending side does not receive acknowledgments and is required to slow down. This effect is called TCP Backpressure and part of TCP Flowcontrol. See also Wikipedia. The subscriber is guaranteed to not overload and that is a protection for the client application. In blocking I/O we get the same level of protection if we properly set up e.g. the JDBC |
Well reactor netty kind of doesn't care too: it will store 'em all in a queue, not in a tcp buffer. |
Right, Reactor Netty can buffer a few messages. If |
Constant size requests to reactor-netty connection [#231]
Encapsulate access to nested sink and demand fields with methods. Replace Atomic* fields with volatile ones that are updated through AtomicLongFieldUpdater. Use Operators.addCap(…) to accumulate demand and to prevent overflow. Introduce buffer for received Conversation that do not have demand. Introduce drainloop to drain the buffer on request(n). Extract constants. Use Operators.on…Dropped(…) to propagate dropped signals. [resolves #231]
Constant size requests to reactor-netty connection [#231]
With a recent change, we no longer propagate the backpressure from the R2DBC SPI (e.g.
Result.map(…)
) toNettyInbound
. Previously, we used windowing and passed theFlux<Message>
directly to the consumer. Now we're usinghandle(…)
and send the messages to the conversation receiver instead of to a window that is directly connected toNettyInbound
.The missing backpressure propagation can lead to overflows.
The text was updated successfully, but these errors were encountered: