adityadtu5 commented on code in PR #1062:
URL: https://github.com/apache/yunikorn-k8shim/pull/1062#discussion_r3774252885


##########
pkg/cache/task.go:
##########
@@ -625,11 +657,20 @@ func (task *Task) failWithEvent(errorMessage, 
actionReason string) {
 // 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.
+       task.lock.RLock()
+       alias := task.alias
+       task.lock.RUnlock()

Review Comment:
   Locking seems correct. It reads values while holding read lock and calls 
`rollbackAllocation` with those values. `rollBackAllocation` takes write lock 
as it updates some values on task.



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