Skip to content
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

Merged
merged 1 commit into from
Apr 10, 2017

Conversation

soltysh
Copy link
Contributor

@soltysh soltysh commented Mar 20, 2017

@@ -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 {
Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@mfojtik
Copy link
Contributor

mfojtik commented Mar 21, 2017

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 --follow). I would much prefer the first one...

And I think we actually have something like that... oc observe can serve as 'wait for tags to be imported'. Maybe we just need to provide more examples on how to use it, or make some derivate of oc observe that will explicitely allow users to 'wait for field XYZ is populated or get value XYZ'

How about a wrapper for oc observe like:

$ oc wait-for is/foo --to-contain=.status.tags["bar"]
$ oc wait-for dc/registry --to-be=running
$ oc wait-for secret/foo --to-exists
...

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.

@fabianofranz @smarterclayton ^

@smarterclayton
Copy link
Contributor

smarterclayton commented Mar 22, 2017 via email

@mfojtik
Copy link
Contributor

mfojtik commented Mar 27, 2017

as discussed on arch call, i'm fine with this for now.

@mfojtik
Copy link
Contributor

mfojtik commented Mar 27, 2017

[test]

1 similar comment
@mfojtik
Copy link
Contributor

mfojtik commented Mar 31, 2017

[test]

@mfojtik
Copy link
Contributor

mfojtik commented Mar 31, 2017

@soltysh

POST /oapi/v1/namespaces/integration/imagestreamimports?timeout=2m0s: (2m0.000878996s) 504

this does not seems right?

@soltysh
Copy link
Contributor Author

soltysh commented Apr 6, 2017

@smarterclayton ptal if the 2nd commit passing request-timeout value all the way down to Request object makes sense, if so I'll open an upstream PR for that.

}
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,
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spawned #13701

@smarterclayton
Copy link
Contributor

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.

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 078e6ea

@soltysh
Copy link
Contributor Author

soltysh commented Apr 10, 2017

@smarterclayton this is only the fix that allows extended timeout for image imports.

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/673/) (Base Commit: 585b160)

@smarterclayton
Copy link
Contributor

LGTM [merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 078e6ea

@openshift-bot
Copy link
Contributor

openshift-bot commented Apr 10, 2017

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)

@openshift-bot openshift-bot merged commit 5129a2d into openshift:master Apr 10, 2017
@soltysh soltysh deleted the bug1433244 branch April 11, 2017 09:53
openshift-merge-robot added a commit that referenced this pull request Feb 9, 2018
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.
openshift-publish-robot pushed a commit to openshift/kubernetes that referenced this pull request Feb 27, 2018
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
openshift-publish-robot pushed a commit to openshift/kubernetes-client-go that referenced this pull request Feb 28, 2018
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants