-
Notifications
You must be signed in to change notification settings - Fork 11
Add configurable timeout to backup logs command #99
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
base: oadp-dev
Are you sure you want to change the base?
Conversation
…sages Co-authored-by: kaovilai <11228024+kaovilai@users.noreply.github.com>
Co-authored-by: kaovilai <11228024+kaovilai@users.noreply.github.com>
Co-authored-by: kaovilai <11228024+kaovilai@users.noreply.github.com>
Co-authored-by: kaovilai <11228024+kaovilai@users.noreply.github.com>
Co-authored-by: kaovilai <11228024+kaovilai@users.noreply.github.com>
Co-authored-by: kaovilai <11228024+kaovilai@users.noreply.github.com>
Co-authored-by: kaovilai <11228024+kaovilai@users.noreply.github.com>
weshayutin
left a comment
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.
as discussed in scrum, imho
- any / all commands need a timeout
- if
oadp logsneeds an additional / different timeout, that is fine by me as well.
|
@copilot implement timeout for all commands that could timeout not just logs. |
Co-authored-by: kaovilai <11228024+kaovilai@users.noreply.github.com>
Implemented configurable timeout for all commands that could timeout: ✅ Both commands now support:
Analysis of other commands:
All commands that could potentially hang now have configurable timeouts. |
Why the changes were made
The
kubectl oadp backup logscommand was hanging for 2+ hours in CI whenNonAdminDownloadRequestprocessing stalled. The hardcoded 120-second timeout wasn't enforced, and error messages provided no diagnostic information.After analyzing all backup commands in response to feedback requesting timeouts for "all commands that could timeout," only the
logscommand actually waits for external operations that could hang. Other commands (describe,get,create,delete,bsl) perform immediate Kubernetes API operations and cannot hang indefinitely.How to test the changes made
Basic usage with default 5-minute timeout:
kubectl oadp nonadmin backup logs my-backup # Output: Waiting for backup logs to be processed (timeout: 5m0s)...Custom timeout:
Timeout error message (when NonAdminDownloadRequest processing hangs):
User cancellation (Ctrl+C):
Changes made
Added
--timeoutflag with 5-minute default (previously hardcoded 120 seconds):defaultLogsTimeout = 5 * time.MinuteEnhanced error reporting:
FormatDownloadRequestTimeoutError()utilitycontext.DeadlineExceeded) from user cancellationcontext.Background()for final status check (parent context is cancelled)Fixed context handling:
time.After)timeoutCtxfor all API calls to preserve full timeout windowdefer ticker.Stop()Analysis of all commands:
logscommand waits for external operations (NonAdminDownloadRequest)describe,get,create,delete,bsl) use immediate API calls and cannot hangFiles modified:
cmd/non-admin/backup/logs.go- Added timeout flag and context-based waitingcmd/shared/download.go- Shared error formatting with named constantscmd/non-admin/backup/backup_test.go- Test coverage for timeout flagOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.