-
Notifications
You must be signed in to change notification settings - Fork 83
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: fix azcopy exec timeout func #1278
Conversation
Hi @umagnus. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
7c73ba1
to
23c3fab
Compare
pkg/blob/controllerserver.go
Outdated
} | ||
return copyErr | ||
case util.AzcopyJobRunning: | ||
return fmt.Errorf("an existed azcopy job is running, copy percent: %s%%, please wait for it to complete", percent) |
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.
wait for the existing AzCopy job to complete, current copy percentage is %s%%
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.
done
pkg/blob/controllerserver.go
Outdated
return nil | ||
}, func() error { | ||
_, percent, _ := d.azcopy.GetAzcopyJob(dstContainerName, authAzcopyEnv) | ||
return fmt.Errorf("timeout waiting for copy blob container %s to %s succeed, copy percent: %s%%", srcContainerName, dstContainerName, percent) |
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.
timeout waiting for copy blob container %s to %s complete, current copy percent: %s%%
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.
done
pkg/blob/controllerserver.go
Outdated
return fmt.Errorf("an existed azcopy job is running, copy percent: %s%%, please wait for it to complete", percent) | ||
case util.AzcopyJobNotFound: | ||
klog.V(2).Infof("copy blob container %s to %s", srcContainerName, dstContainerName) | ||
copyErr := util.WaitForExecCompletion(time.Duration(d.waitForAzCopyTimeoutMinutes)*time.Minute, func() error { |
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.
this is hard to read, can you define execFunc, timeoutFunc as a var outside?
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.
done
pkg/util/util.go
Outdated
// TimeoutFunc returns output and error if an ExecFunc timeout | ||
type TimeoutFunc func() (err error) | ||
|
||
// WaitForExecCompletion waits for the exec function to complete or times out |
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.
WaitForExecCompletion waits for the exec function to complete or return timeout error
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.
done
23c3fab
to
261a3c7
Compare
261a3c7
to
1c44f57
Compare
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.
/ok-to-test
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, umagnus The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherrypick release-1.24 |
/cherrypick release-1.23 |
@andyzhangx: #1278 failed to apply on top of branch "release-1.23":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@andyzhangx: new pull request created: #1285 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
fix: fix azcopy exec timeout func, use WaitForExecCompletion func in util.go waits for the exec function to complete or times out
Which issue(s) this PR fixes:
Fixes #
Requirements:
Special notes for your reviewer:
Release note: