Skip to content

Commit

Permalink
[YUNIKORN-2392] Ensure scheduling tasks are accessed under lock (#784)
Browse files Browse the repository at this point in the history
Concurrent map write detected during performance testing only. The code
has been through all unit and e2e tested and none have triggered the
concurrent write.

No test cases added.

Closes: #784

Signed-off-by: Wilfred Spiegelenburg <[email protected]>
  • Loading branch information
craigcondit authored and wilfred-s committed Feb 9, 2024
1 parent 5f8d20b commit e901279
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cache/external/scheduler_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,10 @@ func (cache *SchedulerCache) removePriorityClass(priorityClass *schedulingv1.Pri
// NotifyTaskSchedulerAction registers the fact that a task has been evaluated for scheduling, and consequently the
// scheduler plugin should move it to the activeQ if requested to do so.
func (cache *SchedulerCache) NotifyTaskSchedulerAction(taskID string) {
cache.lock.Lock()
defer cache.lock.Unlock()
// verify that the pod exists in the cache, otherwise ignore
if _, ok := cache.GetPod(taskID); !ok {
if _, ok := cache.GetPodNoLock(taskID); !ok {
return
}
cache.addSchedulingTask(taskID)
Expand Down

0 comments on commit e901279

Please sign in to comment.