Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • None
    • None
    • shim - kubernetes
    • None

    Description

      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.

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

      Attachments

        Activity

          People

            pbacsko Peter Bacsko
            pbacsko Peter Bacsko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: