-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-serversets: Ensure ZkSession#retrying is resilient to ZK host…
… resolution failure **Problem** Currently, there is no exception handling in `ZkSession#retrying`, since we assume `newZkSession` will always return normally. However, it's possible that `newZkSession` throws `UnknownHostException` if DNS fails and we cannot resolve hosts. This causes the thread responsible for re-establishing the `ZkSession` to terminate and the corresponding `ServiceDiscoverer` to remain unhealthy forever. **Solution** To solve this, we add a new `WatchState` to indicate that a `ZkSession` could not be created (`WatchState.FailedToInitialize`). Then we adapt the reconnect logic in `ZkSession#retrying` to retry on `WatchState.FailedToInitialize` (in addition to session expiry). **Result** `ZkSession#retrying` can recover from intermittent DNS failures. JIRA Issues: COORD-11929 Differential Revision: https://phabricator.twitter.biz/D403895
- Loading branch information
Shakeel Rao
authored and
jenkins
committed
Dec 10, 2019
1 parent
e333c83
commit 7125026
Showing
4 changed files
with
98 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
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