-
Notifications
You must be signed in to change notification settings - Fork 300
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
Improve failover robustness #8405
Conversation
...ator/remote/src/main/java/tech/pegasys/teku/validator/remote/BeaconNodeReadinessManager.java
Outdated
Show resolved
Hide resolved
.../java/tech/pegasys/teku/validator/remote/eventsource/EventSourceBeaconChainEventAdapter.java
Show resolved
Hide resolved
Regarding the tests, It would be great to add a test that covers the |
@@ -97,6 +100,45 @@ public void performsPrimaryReadinessCheckWhenFailoverNotReadyAndNoOtherFailovers | |||
verify(beaconNodeReadinessManager).performPrimaryReadinessCheck(); | |||
} | |||
|
|||
@Test | |||
public void dontJumpBetweenFailoversWhenFailoverIsReady() { |
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.
Maybe rename it to doNotSwitchToFailoverWhenCurrentBeaconNodeIsReady
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.
Nice name, updated
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.
LGTM
Just a small nit
PR Description
Covered following cases:
switchToFailoverEventStreamIfAvailable()
is not always fired when currently used api fails, it could be fired by connection error fallback for example and switch endpoint (not considering primary, when it could be the best) when not neededBeaconNodeReadinessManager
is switched to primary as ready, sent event once and will not repeat it, but by some reason this event slipped inEventSourceBeaconChainEventAdapter
(say callbackswitchToFailoverEventStreamIfAvailable()
fired just after it). Repeated events guarantee that we will switch to primary in this case sooner or later and price is nothing.Wanted to add some tests, but it doesn't look it could be tested easily. Maybe you could provide some suggestion?
Fixed Issue(s)
Fixes #8180 (not 100% on this)
Documentation
doc-change-required
label to this PR if updates are required.Changelog