This is an automated email from the ASF dual-hosted git repository.

wilfreds pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-k8shim.git


The following commit(s) were added to refs/heads/master by this push:
     new e9012794 [YUNIKORN-2392] Ensure scheduling tasks are accessed under 
lock (#784)
e9012794 is described below

commit e9012794fba6e1cd5e0f5f761ca57ddc6b01865a
Author: Craig Condit <[email protected]>
AuthorDate: Fri Feb 9 13:57:39 2024 +1100

    [YUNIKORN-2392] Ensure scheduling tasks are accessed under lock (#784)
    
    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]>
---
 pkg/cache/external/scheduler_cache.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pkg/cache/external/scheduler_cache.go 
b/pkg/cache/external/scheduler_cache.go
index a81977da..5aa6b2fc 100644
--- a/pkg/cache/external/scheduler_cache.go
+++ b/pkg/cache/external/scheduler_cache.go
@@ -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)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to