-
Notifications
You must be signed in to change notification settings - Fork 1
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
Enhance logging in ConsulFailoverInterceptor #309
Merged
sleberknight
merged 6 commits into
master
from
305-enhance-logging-in-consul-failover-interceptor
Dec 17, 2023
Merged
Enhance logging in ConsulFailoverInterceptor #309
sleberknight
merged 6 commits into
master
from
305-enhance-logging-in-consul-failover-interceptor
Dec 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Add maximum failover attempts in ConsulFailoverInterceptor to avoid potential infinite loop. * Set the default maximum to 10 attempts. * Add new method withMaxFailoverAttempts to allow changing the maximum. * Add MaxFailoverAttemptsExceededException as a RuntimeException that is thrown if the maximum failover attempts are exceeded. Closes #304
* If debug level is enabled, log the exception (and stack trace) at debug level. Otherwise, log the exception at warning level including the exception type, but not the stack trace. * Internal refactoring to remove the duplicate calls to get() the value from the Optional<Request>. When inside the loop, we know that the Optional contains a value, so it's annoying to see repetitive calls to nextRequest.get(). Closes #305
@terezivy Note that the base branch for this is 304-add-max-failover-attempts-to-avoid-infinite-loop, not |
Base automatically changed from
304-add-max-failover-attempts-to-avoid-infinite-loop
to
master
December 17, 2023 16:23
terezivy
approved these changes
Dec 17, 2023
* Log warning if Consul failover interceptor is set multiple times * Log a warning in Consul if both withMultipleHostAndPort and withFailoverInterceptor are called when building a Consul instance. * This is important because calling them both results in a "last one wins" scenario, since the last method called sets the failover interceptor. Closes #306 * Update javadocs regarding overriding failover interceptors
* Replace Jetbrains NotNull and VisibleForTesting annotations with the ones from Checker and Guava, respectively. * The reason is that the Jetbrains annotations come in transitively whereas Checker and Guava are both direct dependencies. While not a huge deal, we also have (more or less) standardized on using the Checker annotations for nullability, and on Guava's VisibleForTesting annotation.
The reason is that, since the while loop's Optional#isPresent test was true, the Optional#get call must succeed inside the loop body. Otherwise, something else (i.e., a coding error) is wrong.
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
sleberknight
deleted the
305-enhance-logging-in-consul-failover-interceptor
branch
December 17, 2023 17:10
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #305