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

checking newNode size to make sure its not 0 #520

Merged
merged 5 commits into from
Sep 3, 2024

Conversation

JobseRyan
Copy link

@JobseRyan JobseRyan commented Aug 28, 2024

Adding a check inside NetworkClient for newNodes.size equalling 0 so that 0 isn't passed into:

int offset = this.randOffset.nextInt(newNodes.size());

resulting in logs blowing up due to "java.lang.IllegalArgumentException: bound must be positive".

For tests I have set no bootstrap urls in the client so when i try and resolve addresses none are found and thus no newNodes are found thus setting the size equal to 0 and return null after its initial exception is thrown.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

Copy link

@sutambe sutambe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JobseRyan JobseRyan merged commit cfa6f94 into 3.0-li Sep 3, 2024
25 checks passed
@JobseRyan JobseRyan deleted the user/rjobse/newNodeSize branch September 3, 2024 16:22
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.

2 participants