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][client] Fix ArrayIndexOutOfBoundsException when using SameAuthParamsLookupAutoClusterFailover #23336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Sep 23, 2024

Motivation

There is a mistake in SameAuthParamsLookupAutoClusterFailover.class, which may cause a ArrayIndexOutOfBoundsException, but it affects nothing because it only happens when no server is available.

Modifications

  • Fix the mistake
  • Add an log

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode self-assigned this Sep 23, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 23, 2024
@lhotari
Copy link
Member

lhotari commented Sep 23, 2024

Any chance to add a test case?

@Technoboy- Technoboy- added this to the 4.1.0 milestone Oct 30, 2024
@Technoboy- Technoboy- closed this Oct 30, 2024
@Technoboy- Technoboy- reopened this Oct 30, 2024
@lhotari lhotari changed the title [fix] FIx ArrayIndexOutOfBoundsException when using SameAuthParamsLookupAutoClusterFailover [fix][client] Fix ArrayIndexOutOfBoundsException when using SameAuthParamsLookupAutoClusterFailover Oct 30, 2024
@lhotari
Copy link
Member

lhotari commented Oct 30, 2024

Any chance to add a test case?

@poorbarcode @Technoboy- any chance to handle this?

@@ -123,7 +130,7 @@ private int firstHealthyPulsarService() {
}

private int findFailoverTo() {
for (int i = currentPulsarServiceIndex + 1; i <= pulsarServiceUrlArray.length; i++) {
for (int i = currentPulsarServiceIndex + 1; i < pulsarServiceUrlArray.length; i++) {
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering if this logic is correct in the first place. Shouldn't this wrap around the array?

the for loop in checkPulsarServices looks strange too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants