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

Add defensive copy for Futures allOf() method #2943

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

jinkshower
Copy link
Contributor

@jinkshower jinkshower commented Aug 6, 2024

Closes #2935

I've added defensive copy for the method so that external modification could not affect stages during iteration.

As for test, I can't come up with any better idea so just used two Threads each calling allOf() and modifying stages simultaneously.

Thank you.

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 applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

@jinkshower
Copy link
Contributor Author

jinkshower commented Aug 7, 2024

I've applied provided formatter again! Could you re-run the test please? Thank you in advance.

@tishun
Copy link
Collaborator

tishun commented Aug 8, 2024

I've applied provided formatter again! Could you re-run the test please? Thank you in advance.

You need to fetch the fix from #2949

@jinkshower
Copy link
Contributor Author

You need to fetch the fix from #2949

I've fetched #2949 and pushed it again!

@tishun tishun added the status: waiting-for-feedback We need additional information before we can continue label Aug 30, 2024
@tishun tishun removed the status: waiting-for-feedback We need additional information before we can continue label Sep 16, 2024
@tishun
Copy link
Collaborator

tishun commented Sep 16, 2024

Thanks for the contribution!

@tishun tishun merged commit bf5bd75 into redis:main Sep 16, 2024
5 checks passed
@jinkshower
Copy link
Contributor Author

neat test! Thanks for the polishing commit, learned a lot

tishun added a commit to tishun/lettuce-core that referenced this pull request Nov 1, 2024
* Add defensive copy

Closes redis#2935

* Polishing

* Forgot to call formatter, shame on me

---------

Co-authored-by: Tihomir Mateev <tihomir.mateev@gmail.com>
tishun added a commit that referenced this pull request Nov 1, 2024
* Add defensive copy

Closes #2935

* Polishing

* Forgot to call formatter, shame on me

---------

Co-authored-by: jinkshower <askthem@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seeing ArrayIndexOutOfBoundsException
3 participants