Skip to content

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;

?

this.queryHelper.queryForLimitlessRouters(connection, hostPort);
this.queryHelper.queryForLimitlessRouters(context.getConnection(), context.getHostSpec().getPort());

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 from ae5ff77 to be2b02a Compare November 4, 2024 21:19
@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 force-pushed the fix/limitless-extra-connns branch from dc42231 to 11cb0d2 Compare November 4, 2024 23:49
@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