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

Fix long overflow in RedisSubscription#potentiallyReadMore #2383

Closed
wants to merge 2 commits into from

Conversation

manzhizhen
Copy link

@manzhizhen manzhizhen commented Apr 16, 2023

getDemand() maybe is Long.MAX_VALUE,because MonoNext.NextSubscriber#request(long n) inner use the Long.MAX_VALUE, so maybe "getDemand() + 1" will be overflow,we use "getDemand() > data.size() - 1" replace the "(getDemand() + 1) > data.size()"

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

image

image

yizhenqiang added 2 commits April 16, 2023 20:56
…equest(long n) inner use the Long.MAX_VALUE, so maybe "getDemand() + 1" will be overflow,we use "getDemand() > data.size() - 1" replace the "(getDemand() + 1) > data.size()"
…equest(long n) inner use the Long.MAX_VALUE, so maybe "getDemand() + 1" will be overflow,we use "getDemand() > data.size() - 1" replace the "(getDemand() + 1) > data.size()"
@mp911de mp911de added the type: bug A general bug label Apr 17, 2023
@mp911de mp911de added this to the 6.2.3.RELEASE milestone Apr 17, 2023
mp911de pushed a commit that referenced this pull request Apr 17, 2023


Instead of incrementing the demand plus one, we now deduct one from the available data size (which is an int).
mp911de pushed a commit that referenced this pull request Apr 17, 2023


Instead of incrementing the demand plus one, we now deduct one from the available data size (which is an int).
@mp911de
Copy link
Collaborator

mp911de commented Apr 17, 2023

Thank you for your contribution. That's merged and backported now.

@mp911de mp911de closed this Apr 17, 2023
@mp911de mp911de changed the title Fix the RedisPublisher.RedisSubscription#potentiallyReadMore demand long overflow bug Fix long overflow in RedisSubscription#potentiallyReadMore Apr 17, 2023
@mp911de mp911de modified the milestones: 6.2.3.RELEASE, 6.2.4.RELEASE Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants