-
Notifications
You must be signed in to change notification settings - Fork 395
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
Fix retry function not stopping for long time after sending an interrupt #2486
Merged
imatiach-msft
merged 21 commits into
microsoft:main
from
kartikc727:kartikch/retry-func-fix
Jan 11, 2024
Merged
Fix retry function not stopping for long time after sending an interrupt #2486
imatiach-msft
merged 21 commits into
microsoft:main
from
kartikc727:kartikch/retry-func-fix
Jan 11, 2024
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
imatiach-msft
approved these changes
Jan 10, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2486 +/- ##
==========================================
+ Coverage 85.60% 92.41% +6.80%
==========================================
Files 85 108 +23
Lines 4648 5419 +771
==========================================
+ Hits 3979 5008 +1029
+ Misses 669 411 -258
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Kartik Choudhary <[email protected]>
…7/responsible-ai-toolbox into kartikch/retry-func-fix
Signed-off-by: Kartik Choudhary <[email protected]>
…7/responsible-ai-toolbox into kartikch/retry-func-fix
3 tasks
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.
Description
For interactive use, the retry function could not be interrupted until it came out of sleep.
For example, when going to sleep for 60 seconds using
time.sleep(60)
, if the user sends akeyboard interrupt, that interrupt does not stop the code execution until the 60 seconds are
over and the program comes out of sleep.
By doing 60 calls of
time.sleep(1)
instead, the program will halt in at most 1 second afterthe user sends a keyboard interrupt, while the behavior is unchanged in cases where no interrupt
is sent.
The code falls back to the original behavior of
time.sleep(retry_delay)
if non-integer delaytime is provided.
Checklist