Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Make timeout of any request to the broker globally configurable #2666

Merged
merged 1 commit into from
Jul 18, 2019

Conversation

viviyww
Copy link
Contributor

@viviyww viviyww commented Jun 20, 2019

We find the delay in creating instance binding varies. The current
default is to wait one minute, otherwise the creation is considered
a failure. So I do this patch to solve this problem. And I think this
delay is configured for different usage scenarios or brokers.
For example, when the maximum response time of my service is 1 minute,
we may set it to be 60, While yours is 3 minutes, and then you should
set it to be 180.

This PR is a

  • Feature Implementation
  • Bug Fix
  • Documentation

What this PR does / why we need it:

Which issue(s) this PR fixes

Fixes #

Please leave this checklist in the PR comment so that maintainers can ensure a good PR.

Merge Checklist:

  • New feature
    • Tests
    • Documentation
  • SVCat CLI flag
  • Server Flag for config
    • Chart changes
    • removing a flag by marking deprecated and hiding to avoid
      breaking the chart release and existing clients who provide a
      flag that will get an error when they try to update

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 20, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @viviyww. Thanks for your PR.

I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 20, 2019
@k8s-ci-robot k8s-ci-robot requested review from MHBauer and mszostok June 20, 2019 06:37
@viviyww
Copy link
Contributor Author

viviyww commented Jun 20, 2019

/assign @jberkhahn

@viviyww
Copy link
Contributor Author

viviyww commented Jun 20, 2019

/assign @mszostok

@jberkhahn
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 20, 2019
const testOSBTimeOut = time.Second * 80
_, _, _, testController, _ := newTestController(t, getTestCatalogConfig())
testController.OSBAPITimeOut = testOSBTimeOut
if err := reconcileClusterServiceBroker(t, testController, getTestClusterServiceBroker()); err == nil {
Copy link
Contributor

@mszostok mszostok Jun 20, 2019

Choose a reason for hiding this comment

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

u still have wrong expectation :)

	if err := reconcileClusterServiceBroker(t, testController, getTestClusterServiceBroker()); err != nil {
		t.Fatalf("Unexpected reconcileClusterServiceBroker failure: %v", err)
	}

@@ -286,6 +286,19 @@ func TestReconcileClusterServiceBrokerExistingServiceClassAndServicePlan(t *test
assertNumberOfActions(t, kubeActions, 0)
}

func TestReconcileClusterServiceBrokerSetOSBTimeOut(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I will recheck it, thanks.

@viviyww
Copy link
Contributor Author

viviyww commented Jun 21, 2019

/test pull-service-catalog-unit

@viviyww
Copy link
Contributor Author

viviyww commented Jun 21, 2019

/ok-to-test

@viviyww viviyww force-pushed the master6 branch 2 times, most recently from 748a72c to 840e137 Compare June 21, 2019 03:10
@viviyww
Copy link
Contributor Author

viviyww commented Jun 21, 2019

@mszostok It is ok now, thanks.

@viviyww
Copy link
Contributor Author

viviyww commented Jun 21, 2019

/assign @jberkhahn

@mszostok
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 21, 2019
@viviyww
Copy link
Contributor Author

viviyww commented Jun 25, 2019

/assign @MHBauer

@viviyww
Copy link
Contributor Author

viviyww commented Jul 3, 2019

/assign @jberkhahn Please help to review it or merge it, thanks.

t.Fatalf("This should not fail : %v", err)
}
createdClient := testController.brokerClientManager.clients[NewClusterServiceBrokerKey(getTestClusterServiceBroker().Name)]
if createdClient.clientConfig.TimeoutSeconds != int(testController.OSBAPITimeOut.Seconds()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this match the constant on 239? both client.config/timeoutseconds and testcontroller.osbapitimeout.seconds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it should not be the same. It is just a test case. Thanks for review it.

Copy link
Contributor

Choose a reason for hiding this comment

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

you set them to be the same on line 241. why bother having the const then?

clientConfig := osb.DefaultClientConfiguration()
clientConfig.Name = meta.Name
clientConfig.URL = commonSpec.URL
clientConfig.AuthConfig = authConfig
clientConfig.EnableAlphaFeatures = true
clientConfig.Insecure = commonSpec.InsecureSkipTLSVerify
clientConfig.CAData = commonSpec.CABundle
clientConfig.TimeoutSeconds = int(osbAPITimeOut.Seconds())
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really like that this is a float, but it's what we got.

@MHBauer
Copy link
Contributor

MHBauer commented Jul 3, 2019

I'm confused about where the value is used.

@viviyww
Copy link
Contributor Author

viviyww commented Jul 3, 2019

Please see this issue #2657. I think it needs to be configurable. Take one of our usage scenarios, in the broker we developed, the response time exceeds 60s. And right now we can't use it.

We find the delay in creating instance binding varies. The current
default is to wait one minute, otherwise the creation is considered
a failure. So I do this patch to solve this problem. And I think this
delay is configured for different usage scenarios or brokers.
For example, when the maximum response time of my service is 1 minute,
we may set it to be 60, While yours is 3 minutes, and then you should
set it to be 180.
@k8s-ci-robot k8s-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2019
@jberkhahn
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jberkhahn, viviyww

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2019
@mszostok
Copy link
Contributor

mszostok commented Jul 8, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2019
@mszostok
Copy link
Contributor

mszostok commented Jul 8, 2019

/test pull-service-catalog-xbuild

2 similar comments
@mszostok
Copy link
Contributor

/test pull-service-catalog-xbuild

@mszostok
Copy link
Contributor

/test pull-service-catalog-xbuild

@viviyww
Copy link
Contributor Author

viviyww commented Jul 11, 2019

@mszostok This test case failed for the pkg in the vendor. Maybe it needs to be updated. This problem has little to do with the patch itself. Thanks.

viviyww pushed a commit to viviyww/service-catalog that referenced this pull request Jul 11, 2019
Fix test case pull-service-catalog-xbuild about issue kubernetes-retired#2666
@mszostok
Copy link
Contributor

@viviyww but in logs I can see that /usr/sbin/update-ca-certificates: 75: /usr/sbin/update-ca-certificates: rm: Exec format error is the main error. I know that this build is failing from time to time, but here it's really strange that it failed a few times in a row 🤔

@jberkhahn
Copy link
Contributor

/retest

@k8s-ci-robot k8s-ci-robot merged commit 879696f into kubernetes-retired:master Jul 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants