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 2022/03/06 01:56:35 UTC

[GitHub] [incubator-yunikorn-k8shim] wilfred-s commented on a change in pull request #376: [YUNIKORN-1101] idempotent remove application and remove task in context

wilfred-s commented on a change in pull request #376:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/376#discussion_r820168116



##########
File path: pkg/cache/context.go
##########
@@ -660,11 +660,8 @@ func (ctx *Context) RemoveApplication(appID string) error {
 func (ctx *Context) RemoveApplicationInternal(appID string) error {
 	ctx.lock.Lock()
 	defer ctx.lock.Unlock()
-	if _, exist := ctx.applications[appID]; exist {
-		delete(ctx.applications, appID)
-		return nil
-	}
-	return fmt.Errorf("application %s is not found in the context", appID)
+	delete(ctx.applications, appID)

Review comment:
       I would remove the whole return value from the call. We do not return errors as part of a `deleteNode` in the context as an example.
   
   We can log a message, however we should not log it at a INFO level. DEBUG would be more appropriate for the log level. The message should then just say that we're removing the application or the task. Independent of the fact that the delete really happened. Again check `deleteNode` changes in YUNIKORN-1100 (#375)




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

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

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