Skip to content
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

Enhances FluxReceiver internals #1185

Closed

Conversation

OlegDokuka
Copy link
Contributor

This PR fixes the improper behavior of FluxReceiver when subscription sending might be offloaded to a separate thread (which contradicts to the ReactiveStreams Spec, for more info see -> reactive-streams/reactive-streams-jvm#486 (comment))

Also, since all actions of the FluxReceive class (includes drainReceiver, cancelReceiver, cleanQueue, onInboundXXX) happens within an EventLoop, it makes no sense to use volatile WIP which brings extra overhead. The same applies to SpScUnboundedQueue which can be replaced with the same non-thread-safe analog since there is no racing between offering and draining of data

Signed-off-by: Oleh Dokuka [email protected]

@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2020

Codecov Report

Merging #1185 into master will decrease coverage by 0.07%.
The diff coverage is 59.37%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1185      +/-   ##
============================================
- Coverage     73.41%   73.34%   -0.08%     
+ Complexity     1782     1781       -1     
============================================
  Files           131      131              
  Lines          8185     8186       +1     
  Branches       1125     1128       +3     
============================================
- Hits           6009     6004       -5     
- Misses         1551     1557       +6     
  Partials        625      625              
Impacted Files Coverage Δ Complexity Δ
...eactor/netty/http/client/HttpClientOperations.java 66.84% <33.33%> (-0.36%) 84.00 <0.00> (ø)
...c/main/java/reactor/netty/channel/FluxReceive.java 81.10% <59.25%> (-1.85%) 70.00 <27.00> (-1.00)
...tor/netty/http/client/Http2ConnectionProvider.java 79.75% <100.00%> (ø) 10.00 <0.00> (ø)
...eactor/netty/http/server/HttpServerOperations.java 72.83% <100.00%> (-0.11%) 69.00 <1.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 943cd41...5cbc5fe. Read the comment docs.

@violetagg violetagg added the type/enhancement A general enhancement label Jun 29, 2020
@violetagg violetagg added this to the 0.9.10.RELEASE milestone Jun 29, 2020
@violetagg violetagg requested a review from simonbasle June 29, 2020 07:59
@violetagg violetagg changed the base branch from master to 0.9.x June 29, 2020 08:03
@violetagg violetagg changed the base branch from 0.9.x to master June 29, 2020 08:03
@violetagg
Copy link
Member

@simonbasle PTAL

@OlegDokuka OlegDokuka requested a review from simonbasle June 29, 2020 13:59
@OlegDokuka OlegDokuka force-pushed the enchancement/flux-receiver branch from 87e3f64 to 5cbc5fe Compare June 29, 2020 14:19
violetagg pushed a commit that referenced this pull request Jun 29, 2020
@violetagg
Copy link
Member

@OlegDokuka I squashed and applied the change to 0.9.x branch (5e4bc03) and then forward merge to master.
Thanks for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants