-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Bug 1433244 - allow imageimports to be long runing requests #13458
Conversation
pkg/client/imagestreams.go
Outdated
@@ -109,7 +110,7 @@ func (c *imageStreams) UpdateStatus(stream *imageapi.ImageStream) (result *image | |||
// will be returned if no actual import was requested (the to fields were not set), or an ImageStream if import was requested. | |||
func (c *imageStreams) Import(isi *imageapi.ImageStreamImport) (*imageapi.ImageStreamImport, error) { | |||
result := &imageapi.ImageStreamImport{} | |||
if err := c.r.Post().Namespace(c.ns).Resource("imageStreamImports").Body(isi).Do().Into(result); err != nil { | |||
if err := c.r.Post().Namespace(c.ns).Resource("imageStreamImports").Timeout(2 * time.Minute).Body(isi).Do().Into(result); err != nil { |
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.
@smarterclayton this 2m is wrong, we should use request-timeout
value when specified in client, imho.
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.
Isn't request timeout already set into the value we send to the server? If not, why not?
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.
Yes, request timeout is set and verified inside WithTimeoutForNonLongRunningRequests
filter, but resthandler.go has additional timeout which needs to be set here explicitly. Personally, I'd prefer the value from request-timeout
flag would be applied to this, as well.
I'm pretty much against adding more logic to handle "wait for" (like --follow, etc). Either we need some solution that will work for all cases where users want to "wait for something to happen" or have some consistent flag (like And I think we actually have something like that... How about a wrapper for
I think this might actually help the ansible code as well. Also 50% of our extended tests and test-cmd are just derivation of "wait for XYZ to happen". With a simple DSL that we can extended if we find a case we can simplify all that. |
I'm fine with request-timeout being applied there - that's the effective
request timeout
…On Mon, Mar 20, 2017 at 4:07 PM, Maciej Szulik ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/client/imagestreams.go
<#13458 (comment)>:
> @@ -109,7 +110,7 @@ func (c *imageStreams) UpdateStatus(stream *imageapi.ImageStream) (result *image
// will be returned if no actual import was requested (the to fields were not set), or an ImageStream if import was requested.
func (c *imageStreams) Import(isi *imageapi.ImageStreamImport) (*imageapi.ImageStreamImport, error) {
result := &imageapi.ImageStreamImport{}
- if err := c.r.Post().Namespace(c.ns).Resource("imageStreamImports").Body(isi).Do().Into(result); err != nil {
+ if err := c.r.Post().Namespace(c.ns).Resource("imageStreamImports").Timeout(2 * time.Minute).Body(isi).Do().Into(result); err != nil {
Yes, request timeout is set and verified inside
WithTimeoutForNonLongRunningRequests filter, but resthandler.go
<https://github.com/openshift/origin/blob/612dcfb20d42755959895cc19285b429864ddeba/vendor/k8s.io/kubernetes/pkg/apiserver/resthandler.go#L350>
has additional timeout which needs to be set here explicitly. Personally,
I'd prefer the value from request-timeout flag would be applied to this,
as well.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#13458 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p3UDltPEQI_riSgZsU91qZ3gz3Uyks5rntxogaJpZM4MifVv>
.
|
as discussed on arch call, i'm fine with this for now. |
[test] |
1 similar comment
[test] |
this does not seems right? |
@smarterclayton ptal if the 2nd commit passing |
} | ||
return NewRequest(c.Client, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle) | ||
return NewRequest(c.Client, verb, c.base, c.versionedAPIPath, c.contentConfig, |
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 should be a helper on Request, vs adding something to the constructor. There are lots of reasons to set timeouts per request type.
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.
Spawned #13701
We can merge imagestreamimport separately - let's split the other issue out. There's enough wrinkles we need to deal with there that doing two is better than one. |
Evaluated for origin test up to 078e6ea |
@smarterclayton this is only the fix that allows extended timeout for image imports. |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/673/) (Base Commit: 585b160) |
LGTM [merge] |
Evaluated for origin merge up to 078e6ea |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/304/) (Base Commit: d128020) (Image: devenv-rhel7_6133) |
Automatic merge from submit-queue (batch tested with PRs 18503, 18399, 13701, 18513, 18515). UPSTREAM: 51042: Allow passing request-timeout from NewRequest all the way down This was split from #13458. @smarterclayton let's continue the discussion here.
Automatic merge from submit-queue (batch tested with PRs 18503, 18399, 13701, 18513, 18515). UPSTREAM: 51042: Allow passing request-timeout from NewRequest all the way down This was split from openshift/origin#13458. @smarterclayton let's continue the discussion here. Origin-commit: 0fd7db928c80fe528c51848eebb85b9544beb72f
Automatic merge from submit-queue (batch tested with PRs 18503, 18399, 13701, 18513, 18515). UPSTREAM: 51042: Allow passing request-timeout from NewRequest all the way down This was split from openshift/origin#13458. @smarterclayton let's continue the discussion here. Origin-commit: 0fd7db928c80fe528c51848eebb85b9544beb72f Kubernetes-commit: c6df867ec232478651d96abce6d459be747defed
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1433244.