[ 
https://issues.apache.org/jira/browse/YUNIKORN-2220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wilfred Spiegelenburg closed YUNIKORN-2220.
-------------------------------------------

> pod.DeepCopy() is called twice in Task
> --------------------------------------
>
>                 Key: YUNIKORN-2220
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-2220
>             Project: Apache YuniKorn
>          Issue Type: Sub-task
>          Components: shim - kubernetes
>            Reporter: Peter Bacsko
>            Assignee: Peter Bacsko
>            Priority: Minor
>
> A small improvement is possible in {{task.go}}.
> In {{handleSubmitTaskEvent()}} and {{{}postTaskAllocated(){}}}, we call 
> {{pod.DeepCopy()}} twice to avoid possible race conditions, but a single copy 
> is enough. Once we have a copy, it's local to the method.
> {noformat}
> events.GetRecorder().Eventf(task.pod.DeepCopy(), nil, v1.EventTypeNormal, 
> "Scheduling", "Scheduling",
>               "%s is queued and waiting for allocation", task.alias)
>       // if this task belongs to a task group, that means the app has gang 
> scheduling enabled
>       // in this case, post an event to indicate the task is being gang 
> scheduled
>       if !task.placeholder && task.taskGroupName != "" {
>               events.GetRecorder().Eventf(task.pod.DeepCopy(), nil,
>                       v1.EventTypeNormal, "GangScheduling", "GangScheduling",
>                       "Pod belongs to the taskGroup %s, it will be scheduled 
> as a gang member", task.taskGroupName) <-- second copy if GS is used
>       }
> {noformat}
> {noformat}
> events.GetRecorder().Eventf(task.pod.DeepCopy(),
>       nil, v1.EventTypeNormal, "Scheduled", "Scheduled",
>       "Successfully assigned %s to node %s", task.alias, task.nodeName)
> ...
> events.GetRecorder().Eventf(task.pod.DeepCopy(), nil,
>       v1.EventTypeNormal, "PodBindSuccessful", "PodBindSuccessful",
>       "Pod %s is successfully bound to node %s", task.alias, task.nodeName)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: dev-h...@yunikorn.apache.org

Reply via email to