adityadtu5 commented on code in PR #1062:
URL: https://github.com/apache/yunikorn-k8shim/pull/1062#discussion_r3774280807
##########
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()
+ task.rollbackAllocation(allocationKey, nodeID, "AssumePodFailed",
+ fmt.Sprintf("Node assignment failed for %s on node %s, it will
be retried", alias, nodeID))
+}
+
+// rollbackAllocation resets the task allocation 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) rollbackAllocation(allocationKey, nodeID, eventReason,
eventMsg string) {
Review Comment:
Which go routine you are refering to? I checked and don't see any place
where it is called while holding task lock.
--
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]