-
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
Fixes wrong request accounting in AbstractOnSubscribe #2854
Conversation
break; | ||
} | ||
} | ||
} else | ||
if (n > 0 && state.requestCount.getAndAdd(n) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use BackpressureUtils.getAndAdd here to avoid request overflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I thought I added it because of the visibility changes, but it appears it got lost somewhere.
c7e3b2f
to
622b0a9
Compare
if (!state.subscriber.isUnsubscribed()) { | ||
do { | ||
if (n > 0 && BackpressureUtils.getAndAddRequest(state.requestCount, n) == 0) { | ||
// fast-path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this comment down a line (inside the next if block) for clarity?
LGTM beyond trivial changes mentioned above. Thanks @akarnokd for fixing quickly (as usual)! |
622b0a9
to
674327d
Compare
Done. |
674327d
to
31339a2
Compare
Fixes wrong request accounting in AbstractOnSubscribe
Fixes #2853.