You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/01/06 01:37:24 UTC

[GitHub] [incubator-yunikorn-core] yangwwei opened a new pull request #235: [YUNIKORN-499] UT failed because of data race in TestApplicationScheduling.

yangwwei opened a new pull request #235:
URL: https://github.com/apache/incubator-yunikorn-core/pull/235


   The data race happens [here](https://github.com/apache/incubator-yunikorn-core/blob/5471d84cd619dc9b6c40e970b0e9d53aa3f8e07f/pkg/scheduler/objects/sorters.go#L84): 
   
   ```
   func filterOnPendingResources(apps map[string]*Application) []*Application {
     ////
     if resources.StrictlyGreaterThanZero(app.GetPendingResource())
     ////
   ```
   
   this is because, at the same time, the app is being updated by adding an ask. this updates the `pending` resource of this app, which is a pointer `*resources.Resource`. And above code will read `app.pending` without holding app's RLock. 
   
   ```
   func (sa *Application) AddAllocationAsk(ask *AllocationAsk) error {
      ...
      // Update total pending resource
      delta.SubFrom(oldAskResource)
      sa.pending.AddTo(delta)
      sa.queue.incPendingResource(delta)
     ....
   }
   ```
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-yunikorn-core] yangwwei closed pull request #235: [YUNIKORN-499] UT failed because of data race in TestApplicationScheduling.

Posted by GitBox <gi...@apache.org>.
yangwwei closed pull request #235:
URL: https://github.com/apache/incubator-yunikorn-core/pull/235


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org