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: limitless - reduce extraneous conns made on first connection + s… #1174

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

aaronchung-bitquill
Copy link
Contributor

…hift connection logic from plugin to service class

Summary

Description

Additional Reviewers

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@aaronchung-bitquill aaronchung-bitquill force-pushed the fix/limitless-extra-connns branch 5 times, most recently from 82c6522 to ae5ff77 Compare November 4, 2024 10:04
@aaronchung-bitquill aaronchung-bitquill marked this pull request as ready for review November 4, 2024 17:20
}

try {
if (selectedHostSpec == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This code should be out of try-final. At line 148?

final int maxRetries = LimitlessConnectionPlugin.MAX_RETRIES.getInteger(context.getProps());

while (retryCount++ < maxRetries) {
if (context.getLimitlessRouters()
Copy link
Contributor

Choose a reason for hiding this comment

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

We need a null check for getLimitlessRouters()

}
}

HostSpec selectedHostSpec = context.getHostSpec();
Copy link
Contributor

Choose a reason for hiding this comment

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

HostSpec selectedHostSpec = null
?

}
Thread.sleep(retryIntervalMs);
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
Copy link
Contributor

@sergiyvamz sergiyvamz Nov 4, 2024

Choose a reason for hiding this comment

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

Thread.currentThread().interrupt();
return;

?


context.setLimitlessRouters(newLimitlessRouters);
Copy link
Contributor

Choose a reason for hiding this comment

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

if (!Utils.isNullOrEmpty(newLimitlessRouters)) {
...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a line to throw an exception in case the it is either null or empty.
Reason for this is so that #synchronouslyGetLimitlessRoutersWithRetry can catch it and retry.
Otherwise if context.limitlessRouters is not null or empty for some reason, it will not retry.

@aaronchung-bitquill aaronchung-bitquill force-pushed the fix/limitless-extra-connns branch 2 times, most recently from 578ba0a to dc42231 Compare November 4, 2024 23:13
…hift connection logic from plugin to service class
@aaronchung-bitquill aaronchung-bitquill enabled auto-merge (squash) November 4, 2024 23:50
@aaronchung-bitquill aaronchung-bitquill merged commit 6544b75 into aws:main Nov 5, 2024
5 checks passed
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