You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2020/12/01 07:43:11 UTC

[GitHub] [incubator-yunikorn-k8shim] HuangTing-Yao commented on a change in pull request #208: [YUNIKORN-469]Implement recycling service in PlaceholderManager that cleans up orphan placeholders

HuangTing-Yao commented on a change in pull request #208:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/208#discussion_r533128340



##########
File path: pkg/cache/placeholder_manager.go
##########
@@ -97,3 +98,22 @@ func (mgr *PlaceholderManager) setMockedClients(mockedClients *client.Clients) {
 	defer mgr.Unlock()
 	mgr.clients = mockedClients
 }
+
+func (mgr *PlaceholderManager) cleanOrphanPlaceholders() {

Review comment:
       ok, done.

##########
File path: pkg/cache/placeholder_manager.go
##########
@@ -97,3 +98,22 @@ func (mgr *PlaceholderManager) setMockedClients(mockedClients *client.Clients) {
 	defer mgr.Unlock()
 	mgr.clients = mockedClients
 }
+
+func (mgr *PlaceholderManager) cleanOrphanPlaceholders() {
+	for taskID, pod := range mgr.orphanPod {
+		err := mgr.clients.KubeClient.Delete(pod)

Review comment:
       ok,done.

##########
File path: pkg/cache/placeholder_manager.go
##########
@@ -97,3 +98,22 @@ func (mgr *PlaceholderManager) setMockedClients(mockedClients *client.Clients) {
 	defer mgr.Unlock()
 	mgr.clients = mockedClients
 }
+
+func (mgr *PlaceholderManager) cleanOrphanPlaceholders() {
+	for taskID, pod := range mgr.orphanPod {
+		err := mgr.clients.KubeClient.Delete(pod)
+		if err == nil {
+			delete(mgr.orphanPod, taskID)
+		}
+	}
+}
+
+func (mgr *PlaceholderManager) Start() {

Review comment:
       ok,done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org