[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/ponresourcemanager/ponresourcemanager.go b/vendor/github.com/opencord/voltha-lib-go/v7/pkg/ponresourcemanager/ponresourcemanager.go
index d751723..807d4c8 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v7/pkg/ponresourcemanager/ponresourcemanager.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v7/pkg/ponresourcemanager/ponresourcemanager.go
@@ -192,6 +192,17 @@
 	return kvbackend
 }
 
+func (PONRMgr *PONResourceManager) CloseKVClient(ctx context.Context) {
+	if PONRMgr.KVStore != nil {
+		PONRMgr.KVStore.Client.Close(ctx)
+		PONRMgr.KVStore = nil
+	}
+	if PONRMgr.KVStoreForConfig != nil {
+		PONRMgr.KVStoreForConfig.Client.Close(ctx)
+		PONRMgr.KVStoreForConfig = nil
+	}
+}
+
 // NewPONResourceManager creates a new PON resource manager.
 func NewPONResourceManager(ctx context.Context, Technology string, DeviceType string, DeviceID string, Backend string, Address string, basePathKvStore string) (*PONResourceManager, error) {
 	var PONMgr PONResourceManager
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")
diff --git a/vendor/github.com/opencord/voltha-lib-go/v7/pkg/techprofile/tech_profile_if.go b/vendor/github.com/opencord/voltha-lib-go/v7/pkg/techprofile/tech_profile_if.go
index 89a66b2..c936a56 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v7/pkg/techprofile/tech_profile_if.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v7/pkg/techprofile/tech_profile_if.go
@@ -25,6 +25,7 @@
 
 type TechProfileIf interface {
 	SetKVClient(ctx context.Context, pathPrefix string) *db.Backend
+	CloseKVClient(ctx context.Context)
 	GetTechProfileInstanceKey(ctx context.Context, tpID uint32, uniPortName string) string
 	GetTPInstance(ctx context.Context, path string) (interface{}, error)
 	CreateTechProfileInstance(ctx context.Context, tpID uint32, uniPortName string, intfID uint32) (interface{}, error)
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 6de13ee..faaca9c 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -135,7 +135,7 @@
 github.com/klauspost/compress/huff0
 github.com/klauspost/compress/zstd
 github.com/klauspost/compress/zstd/internal/xxhash
-# github.com/opencord/voltha-lib-go/v7 v7.3.2
+# github.com/opencord/voltha-lib-go/v7 v7.4.1
 ## explicit
 github.com/opencord/voltha-lib-go/v7/pkg/config
 github.com/opencord/voltha-lib-go/v7/pkg/db