[VOL-4931] openoltAdapter: memory leak seen in long term tests
Change-Id: Ieb60bd9b4bdf88fc22a3b6704854591c0c30717d
diff --git a/vendor/github.com/opencord/voltha-lib-go/v7/pkg/techprofile/tech_profile.go b/vendor/github.com/opencord/voltha-lib-go/v7/pkg/techprofile/tech_profile.go
index 6d68f5a..dce43ed 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v7/pkg/techprofile/tech_profile.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v7/pkg/techprofile/tech_profile.go
@@ -178,6 +178,21 @@
*/
}
+func (t *TechProfileMgr) CloseKVClient(ctx context.Context) {
+ if t.config.KVBackend != nil {
+ t.config.KVBackend.Client.Close(ctx)
+ t.config.KVBackend = nil
+ }
+ if t.config.DefaultTpKVBackend != nil {
+ t.config.DefaultTpKVBackend.Client.Close(ctx)
+ t.config.DefaultTpKVBackend = nil
+ }
+ if t.config.ResourceInstanceKVBacked != nil {
+ t.config.ResourceInstanceKVBacked.Client.Close(ctx)
+ t.config.ResourceInstanceKVBacked = nil
+ }
+}
+
func NewTechProfile(ctx context.Context, resourceMgr iPonResourceMgr, kvStoreType string, kvStoreAddress string, basePathKvStore string) (*TechProfileMgr, error) {
var techprofileObj TechProfileMgr
logger.Debug(ctx, "initializing-techprofile-mananger")