-
Notifications
You must be signed in to change notification settings - Fork 541
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
Remove Exponential Backoff for Retry Until Up #2821
Merged
Michaelvll
merged 11 commits into
skypilot-org:master
from
rohanvaidya45:remove_exponential_backoff_for_retry
Dec 6, 2023
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4fa6195
remove exponential backoff
rohanvaidya45 ffdd89d
add back random jitter
rohanvaidya45 02195f2
format
rohanvaidya45 0ecd351
use backoff
rohanvaidya45 406a887
format
rohanvaidya45 86f4e8d
add comment
rohanvaidya45 7dfab40
rerun checks
rohanvaidya45 92ae668
format
rohanvaidya45 dcce5b1
pylint
rohanvaidya45 cfd41ad
form
rohanvaidya45 2b2d20d
change to 30
rohanvaidya45 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,7 @@ | |
|
||
# Time gap between retries after failing to provision in all possible places. | ||
# Used only if --retry-until-up is set. | ||
_RETRY_UNTIL_UP_INIT_GAP_SECONDS = 60 | ||
_RETRY_UNTIL_UP_INIT_GAP_SECONDS = 30 | ||
|
||
# The maximum retry count for fetching IP address. | ||
_FETCH_IP_MAX_ATTEMPTS = 3 | ||
|
@@ -2859,7 +2859,13 @@ def _provision( | |
# TODO(suquark): once we have sky on PyPI, we should directly | ||
# install sky from PyPI. | ||
local_wheel_path, wheel_hash = wheel_utils.build_sky_wheel() | ||
backoff = common_utils.Backoff(_RETRY_UNTIL_UP_INIT_GAP_SECONDS) | ||
# The most frequent reason for the failure of a provision | ||
# request is resource unavailability instead of rate | ||
# limiting; to make users wait shorter, we do not make | ||
# backoffs exponential. | ||
backoff = common_utils.Backoff( | ||
initial_backoff=_RETRY_UNTIL_UP_INIT_GAP_SECONDS, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just tried a few clouds and it seems we can also reduce this |
||
max_backoff_factor=1) | ||
attempt_cnt = 1 | ||
while True: | ||
# For on-demand instances, RetryingVmProvisioner will retry | ||
|
@@ -2913,7 +2919,7 @@ def _provision( | |
f'{colorama.Style.BRIGHT}=== Retry until up ===' | ||
f'{colorama.Style.RESET_ALL}\n' | ||
f'Retrying provisioning after {gap_seconds:.0f}s ' | ||
'(exponential backoff with random jittering). ' | ||
'(backoff with random jittering). ' | ||
f'Already tried {attempt_cnt} attempt{plural}.') | ||
attempt_cnt += 1 | ||
time.sleep(gap_seconds) | ||
|
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.
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.
Worth a comment on why we disable exponential backoff. Something like:
The most frequent reason for the failure of a provision request is resource unavailability instead of rate limiting; to make users wait shorter, we do not make the backoffs exponential.
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.
Sounds great