ryankert01 commented on code in PR #873:
URL: https://github.com/apache/yunikorn-k8shim/pull/873#discussion_r1712990373
##########
pkg/cache/context.go:
##########
@@ -873,19 +871,19 @@ func (ctx *Context) StartPodAllocation(podKey string,
nodeID string) bool {
return ctx.schedulerCache.StartPodAllocation(podKey, nodeID)
}
-func (ctx *Context) notifyTaskComplete(appID, taskID string) {
- log.Log(log.ShimContext).Debug("NotifyTaskComplete",
- zap.String("appID", appID),
- zap.String("taskID", taskID))
- if app := ctx.GetApplication(appID); app != nil {
- log.Log(log.ShimContext).Debug("release allocation",
- zap.String("appID", appID),
+func (ctx *Context) notifyTaskComplete(app *Application, taskID string) {
+ if app == nil {
+ log.Log(log.ShimContext).Debug("In notifyTaskComplete but app
is nil",
zap.String("taskID", taskID))
- ev := NewSimpleTaskEvent(appID, taskID, CompleteTask)
- dispatcher.Dispatch(ev)
- if app.GetApplicationState() == ApplicationStates().Resuming {
- dispatcher.Dispatch(NewSimpleApplicationEvent(appID,
AppTaskCompleted))
- }
+ return
+ }
+ log.Log(log.ShimContext).Debug("notifyTaskComplete and release
allocation",
Review Comment:
I change the message to "notifyTaskComplete and release allocation" because
I combine 2 logs to make it only log once. Perhaps I can change it to " release
allocation in notifyTaskComplete"?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]