wilfred-s commented on code in PR #1052:
URL: https://github.com/apache/yunikorn-k8shim/pull/1052#discussion_r3746693344


##########
pkg/cache/task.go:
##########
@@ -620,6 +620,58 @@ func (task *Task) failWithEvent(errorMessage, actionReason 
string) {
        dispatcher.Dispatch(NewFailTaskEvent(task.applicationID, task.taskID, 
errorMessage))
 }
 
+// rollbackOnAssumePodFailure is called when AssumePod fails after all retries.
+// It resets task state and notifies the core to move the allocation back to a
+// pending ask so it can be re-scheduled on a different node.
+// Must be called without holding the task lock.
+func (task *Task) rollbackOnAssumePodFailure(allocationKey, nodeID string) {
+       // Read fields needed for event posting and release request under read 
lock.
+       task.lock.RLock()
+       podCopy := task.pod.DeepCopy()
+       alias := task.alias
+       appID := task.applicationID
+       partition := task.application.partition
+       task.lock.RUnlock()

Review Comment:
   sounds good, one lock to do all the changes



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

Reply via email to