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/11/25 08:47:09 UTC

[GitHub] [incubator-yunikorn-k8shim] HuangTing-Yao commented on a change in pull request #207: [YUNIKORN-459]Implement the placeholder cleanup in PlaceholderManager

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



##########
File path: pkg/cache/placeholder_manager.go
##########
@@ -70,10 +70,28 @@ func (mgr *PlaceholderManager) createAppPlaceholders(app *Application) error {
 	return nil
 }
 
-// recycle all the placeholders for an application
-func (mgr *PlaceholderManager) Recycle(appID string) {
-	log.Logger().Info("start to recycle app placeholders",
-		zap.String("appID", appID))
+// clean up all the placeholders for an application
+func (mgr *PlaceholderManager) CleanUp(app *Application) {
+	log.Logger().Info("start to clean up app placeholders",
+		zap.String("appID", app.GetApplicationID()))
+	for taskID, task := range app.taskMap {
+		if task.GetTaskPlaceholder() {
+			// remove pod
+			err := mgr.clients.KubeClient.Delete(task.pod)
+			if err != nil {
+				log.Logger().Error("failed to clean up placeholder pod",
+					zap.Error(err))

Review comment:
       OK, I have add `orphanpod` map in placeholder manager. 
   And leverage it in YUNIKORN-469




----------------------------------------------------------------
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