-
Notifications
You must be signed in to change notification settings - Fork 46
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
fix: limitless - reduce extraneous conns made on first connection + s… #1174
Conversation
82c6522
to
ae5ff77
Compare
} | ||
|
||
try { | ||
if (selectedHostSpec == null) { |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!Utils.isNullOrEmpty(newLimitlessRouters)) {
...
}
There was a problem hiding this comment.
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.
wrapper/src/main/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterServiceImpl.java
Outdated
Show resolved
Hide resolved
ae5ff77
to
be2b02a
Compare
578ba0a
to
dc42231
Compare
…hift connection logic from plugin to service class
dc42231
to
11cb0d2
Compare
…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.