-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lease: retry errors claiming lease in
LeaseManager::spawn
(#148)
Currently, if the `ensure_claimed` call in the `LeaseManager::spawn` background task fails, the entire task will bail and terminate immediately. This is not desirable, as the intended use of `LeaseManager::spawn` is to spawn a single background task that will manage leasses for the entire lifetime of a controller process, and it should not terminate in the face of a transient error claiming the lease. This branch changes `LeaseManager::spawn` to retry transient errors with an exponential backoff strategy. Exponential backoffs are implemented using the `backoff` crate, but --- because this dependency is not exposed in the public API -- this is strictly an implementation detail, and the dependency can be swapped out for another exponential backoff implementation later, if desired. Errors marked as transient and retried include network errors communicating with the API server, errors parsing the API server response, and HTTP error statuses returned by the API server. Errors that result from a bad configuration or missing permissions are treated as fatal, as they are unlikely to ever succeed after retrying.
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
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