wilfred-s commented on code in PR #810:
URL: https://github.com/apache/yunikorn-k8shim/pull/810#discussion_r1551141038
##########
pkg/cache/scheduler_callback.go:
##########
@@ -56,11 +56,20 @@ func (callback *AsyncRMCallback) UpdateAllocation(response
*si.AllocationRespons
zap.String("nodeID", alloc.NodeID))
// update cache
+ task := callback.context.getTask(alloc.ApplicationID,
alloc.AllocationKey)
+ if task != nil {
+ task.setAllocationID(alloc.AllocationID)
+ } else {
+ log.Log(log.ShimRMCallback).Warn("Unable to get task",
zap.String("taskID", alloc.AllocationKey))
+ }
if err := callback.context.AssumePod(alloc.AllocationKey,
alloc.NodeID); err != nil {
+ if task != nil {
+ task.failWithEvent(err.Error(),
"AssumePodError")
+ }
return err
}
if app := callback.context.GetApplication(alloc.ApplicationID);
app != nil {
- if task :=
callback.context.getTask(app.GetApplicationID(), alloc.AllocationKey); task !=
nil {
+ if task != nil {
Review Comment:
This needs a cleanup: `getTask()` already checks for the application. On top
of that we have the appID already in the task so we do not need to get it from
the app. That needs to be applied to the whole function (new jira)
--
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]