You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
• Failure in Spec Teardown (AfterEach) [300.360 seconds]
[k8s.io] LimitRange
/data/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/test/e2e/framework/framework.go:793
should create a LimitRange with defaults and ensure pod has those defaults applied. [AfterEach]
/data/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/test/e2e/limit_range.go:102
Sep 26 03:54:52.649: Couldn't delete ns: "e2e-tests-limitrange-c4yb1": namespace e2e-tests-limitrange-c4yb1 was not deleted with limit: timed out waiting for the condition, namespace is empty but is not yet removed (&errors.errorString{s:"namespace e2e-tests-limitrange-c4yb1 was not deleted with limit: timed out waiting for the condition, namespace is empty but is not yet removed"})
/data/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/test/e2e/framework/framework.go:338
Oct 10 13:22:56.858: INFO: Waiting up to 1m0s for all nodes to be ready
STEP: Destroying namespace "e2e-tests-limitrange-9t4ap" for this suite.
Oct 10 13:27:56.903: INFO: Couldn't delete ns: "e2e-tests-limitrange-9t4ap": namespace
Which makes it look like 5 minute timeout is sometimes not enough for namespace to be deleted. I am thinking of increasing Namespace deletion timeout just for this e2e test case.
i would rather carry a local patch that bumps the timeout instead of bumping the timeout in upstream kube. it's more likely that because openshift project deletion is more complicated than upstream by virtue of dual namespace finalizers that is causing this flake.
kube tests should only be creating kube resources, right? I would expect all the origin resource lists to be empty, and namespaces not take noticeably longer to delete in origin. do we know the average time to deletion upstream?
So I ran some comparison between time taken to delete a namespace in openshift vs k8s:
For OpenShift
Time taken for deleting namespace 240.018105771
Time taken for deleting namespace 240.005871789
For k8s:
Time is took to delete a namespace is 125.002902668
Time is took to delete a namespace is 205.002347593
Time is took to delete a namespace is 125.002965305
This is running on same hardware btw. @liggitt What you think? Can we merge the flake PR?
The times are in seconds yes. The tests are only creating kube resources. In fact - e2e test file(limit_range.go) in kube and origin are identical. But when I did oc get namespace foo -o yaml - there is an additional finalizer listed for namespaces created in openshift .
@derekwaynecarr do you know why the original namespace finalizer would add 1-2 minutes to clean up a namespace containing no origin resources? Seems like it would be a bunch of list calls returning nothing, then a single finalize call to remove the origin finalizer. Both controllers already retry the finalize call on conflict errors.
Just to make it clearer - please take above benchmarks with pinch of salt. I only posted highest values I saw. The time taken varies between 20s to 240s in case of origin and 20s to 205s in case of k8s.
I am looking at bits of code that gets invoked when a namespace is deleted.
@liggitt@derekwaynecarr so I did some more debugging around this and found that - origin finalizer is actually running multiple times when a namespace is deleted. And it isn't running multiple times because previous invocation of finalizer failed or something, but it is running even if previous invocation deleted all the origin resources and was successful.
caused by the project lifecycle admission plugin re-adding the origin finalizer when admitting creations to a terminating namespace
the plugin used to check if the namespace was terminating and reject out-of-hand, but that meant a rapid (delete ns, create ns, create resource) would either fail (if the plugin rejected if it thought the ns was terminating), or incorrectly not add the origin finalizer (if the plugin skipped adding the finalizer if it thought the ns was terminating)
Activity
gnufied commentedon Oct 5, 2016
@derekwaynecarr are you working on this? If not I would like to take a stab at it?
derekwaynecarr commentedon Oct 6, 2016
Please do.
On Wednesday, October 5, 2016, Hemant Kumar [email protected]
wrote:
mfojtik commentedon Oct 10, 2016
bumping the priority as this can be seen more and more often.
gnufied commentedon Oct 11, 2016
So far from my debugging, I have found following:
And yet the conformance test logs print:
Which makes it look like 5 minute timeout is sometimes not enough for namespace to be deleted. I am thinking of increasing Namespace deletion timeout just for this e2e test case.
gnufied commentedon Oct 12, 2016
I have opened a PR in upstream repo - kubernetes/kubernetes#34614
0xmichalis commentedon Oct 13, 2016
Another instance of this in the deployment suite:
https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_conformance/7195/testReport/junit/(root)/Extended/deploymentconfigs_when_run_iteratively__Conformance__should_immediately_start_a_new_deployment/
cc: @mfojtik
derekwaynecarr commentedon Oct 14, 2016
i would rather carry a local patch that bumps the timeout instead of bumping the timeout in upstream kube. it's more likely that because openshift project deletion is more complicated than upstream by virtue of dual namespace finalizers that is causing this flake.
liggitt commentedon Oct 14, 2016
kube tests should only be creating kube resources, right? I would expect all the origin resource lists to be empty, and namespaces not take noticeably longer to delete in origin. do we know the average time to deletion upstream?
gnufied commentedon Oct 14, 2016
I can find out average time it takes to delete the namespace in upstream, but something to be noted is - upstream does not have this particular flake. They have many flakes around LimitRange tests - https://github.com/kubernetes/kubernetes/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3Akind%2Fflake%20LimitRange but not this one.
gnufied commentedon Oct 20, 2016
So I ran some comparison between time taken to delete a namespace in openshift vs k8s:
For OpenShift
For k8s:
This is running on same hardware btw. @liggitt What you think? Can we merge the flake PR?
liggitt commentedon Oct 20, 2016
those times are in seconds? is this test creating any openshift resources or just kube resources?
gnufied commentedon Oct 20, 2016
The times are in seconds yes. The tests are only creating kube resources. In fact - e2e test file(limit_range.go) in kube and origin are identical. But when I did
oc get namespace foo -o yaml- there is an additional finalizer listed for namespaces created in openshift .liggitt commentedon Oct 20, 2016
@derekwaynecarr do you know why the original namespace finalizer would add 1-2 minutes to clean up a namespace containing no origin resources? Seems like it would be a bunch of list calls returning nothing, then a single finalize call to remove the origin finalizer. Both controllers already retry the finalize call on conflict errors.
gnufied commentedon Oct 21, 2016
Just to make it clearer - please take above benchmarks with pinch of salt. I only posted highest values I saw. The time taken varies between 20s to 240s in case of origin and 20s to 205s in case of k8s.
I am looking at bits of code that gets invoked when a namespace is deleted.
liggitt commentedon Oct 21, 2016
Right, but I'd expect 2-3 seconds overhead for the origin namespace max
gnufied commentedon Oct 26, 2016
@liggitt @derekwaynecarr so I did some more debugging around this and found that - origin finalizer is actually running multiple times when a namespace is deleted. And it isn't running multiple times because previous invocation of finalizer failed or something, but it is running even if previous invocation deleted all the origin resources and was successful.
So basically this https://github.com/openshift/origin/blob/master/pkg/project/admission/lifecycle/admission.go#L52 code runs again and again (like 5-10 times) while the namespace is being deleted and it adds back the previously deleted openshift finalizer.
I tried printing attributes of admission when this happens and got something like:
liggitt commentedon Oct 26, 2016
caused by the project lifecycle admission plugin re-adding the origin finalizer when admitting creations to a terminating namespace
the plugin used to check if the namespace was terminating and reject out-of-hand, but that meant a rapid (delete ns, create ns, create resource) would either fail (if the plugin rejected if it thought the ns was terminating), or incorrectly not add the origin finalizer (if the plugin skipped adding the finalizer if it thought the ns was terminating)
mustfix for 1.4
liggitt commentedon Oct 27, 2016
debugged back to before the rebase onto kube 1.4 and still encountered the issue