kubernetes: Deployment Integration Test Goroutine Limit Exceeded
What happened:
When number of deployment integration tests increases more than a threshold, an error running race: limit on 8192 simultaneously alive goroutines is exceeded, dying
happens when running the tests locally using bazel. The error does not happen when the number of tests is small.
What you expected to happen: The integration tests should not create so many alive goroutines (more than 8192).
How to reproduce it (as minimally and precisely as possible):
(1) Duplicate each deployment tests under test/integration/deployment
directory twice with a digit identifier
(2) bazel build //test/integration/deployment/...
(3) bazel test //test/integration/deployment/...
Anything else we need to know?: The error also happens for replicaset. It may be related to how integration test environment is set up.
/kind bug /sig apps
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (13 by maintainers)
The goroutines sampled above seem to be part of the client sitting between the REST Store and etcd. Perhaps it will help to incorporate calls to
DestroyFunc
somewhere in the integration framework?https://github.com/kubernetes/kubernetes/blob/77c8b6eadfed09c471e5d3ce20bc3480189cde2d/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go#L173-L174
@kubernetes/sig-api-machinery-bugs Is it expected that an integration test would exceed 8192 goroutines (mostly started in apiserver code) if it starts a number of apiservers? That seems excessive to me, but if it’s normal we should probably limit the concurrency of integration tests. If it’s not normal, it seems like we are leaking goroutines.
Some examples of what those 8192 goroutines are doing: