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
reduce goroutine leakage in test/integration/controlplane/transformation
#111674
Comments
/cc |
@aramase if you are too busy, just add a description on where the problem is and, if possible, suggestions on how to fix it, there is always people wanting to help with these things |
Comment #108483(comment) might help.
kubernetes/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go Line 245 in 18ce801
|
I was thinking in something like diff --git a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go
index 30795d41a87..d6792c73479 100644
--- a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go
+++ b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go
@@ -44,6 +44,8 @@ type Service interface {
Decrypt(data []byte) ([]byte, error)
// Encrypt bytes to a ciphertext.
Encrypt(data []byte) ([]byte, error)
+ // Stop the service and close the connections.
+ Stop()
}
type envelopeTransformer struct {
diff --git a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope_test.go b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope_test.go
index 4f030772eb9..adc131bea1a 100644
--- a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope_test.go
+++ b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope_test.go
@@ -71,6 +71,9 @@ func (t *testEnvelopeService) Rotate() {
t.keyVersion = strconv.FormatInt(int64(i+1), 10)
}
+func (t *testEnvelopeService) Stop() {
+}
+
func newTestEnvelopeService() *testEnvelopeService {
return &testEnvelopeService{
keyVersion: "1",
diff --git a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go
index c5304cd09f2..189119f8d31 100644
--- a/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go
+++ b/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go
@@ -152,3 +152,9 @@ func (g *gRPCService) interceptor(
return invoker(ctx, method, req, reply, cc, opts...)
}
+
+func (g *gRPCService) Stop() {
+ g.mux.Lock()
+ defer g.mux.Unlock()
+ g.connection.Close()
+} if someone wants to give it a shot, to hook the Close() with the Storage() |
/milestone v1.26 |
Following up on #111126 (comment) to shutdown the gRPC goroutines and reduce the number of leaked goroutines.
/sig auth
The text was updated successfully, but these errors were encountered: