-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
for/team-attentionThis issue needs team attention or actionThis issue needs team attention or actionstatus/need-designThis needs more in depth design workThis needs more in depth design worktype/enhancementA general enhancementA general enhancement
Milestone
Description
At the moment we have unconsolidated behaviors in the operators' fusion, which exposed how downstream (a.k.a Queue Drainer) notifies upstream (a.k.a Queue Source) about completion on doing any operators with a queue. This consolidation is even more important in the light when all the elements from the queue MUST be discarded.
This issue stands for providing a clear contract between upstream and downstream in case of fusion between them:
If Fusion established then:
- The Queue source must never call methods
pollorclearon its queue until it is notified that downstream is not working with that queue. - The Queue source upon reception of the
clearcall, must discard all the elements from the queue if the queue is known as finite - The Queue drainer must notify the queue source via the
queueSubscription.clearmethod that it is done with all operation on that queue and will never call thepollmethod anymore - The Queue drainer must call the
queueSubscription.clearonly once and ensure it is never called concurrently. - The Queue drainer must call the
queueSubscription.clearafter reception of any of the terminal signals which are (ON_ERROR, ON_COMPLETE, and CANCEL)
if Fusion not established then:
- The Queue source must manage the queue on its own and is responsible for terminating all interaction with that queue upon reception of any of the terminal signals which are (ON_ERROR, ON_COMPLETE, and CANCEL) and discarding all the elements from it if the queue is known as finite
By consolidating the behaviors, we will be able to resolve a list of issues related to cases when downstream try to blindly discard elements from the upstream's queue without full context:
- FluxIterable fused with any downstream led to infinity looping if the source iterable is infinite (Spring Boot RSocket high CPU usage after client disconnects rsocket/rsocket-java#992)
- FluxStream fused with any downstream let to infinity looping if the source is an infinite stream.
- FluxGenerate fused with any downstream let to infinity looping if the generate is infinite.
Metadata
Metadata
Assignees
Labels
for/team-attentionThis issue needs team attention or actionThis issue needs team attention or actionstatus/need-designThis needs more in depth design workThis needs more in depth design worktype/enhancementA general enhancementA general enhancement