wilfred-s commented on pull request #213:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/213#issuecomment-703963453


   > But even we are using that approach, I guess it is still needed to fix the 
NPE in createSchedulingQueue (), correct? I mean this could happen even in the 
case while calling by the placement rule logic. @wilfred-s could you please 
take another look and let us know if this is needed?
   
   No, when the rule is in we are good as the rule makes sure that the name is 
fully qualified and will add the missing `root.`
   The problem is not the fact that the `.` is missing it is the fact that the 
name is not fully qualified. When we call out to create a queue it must be 
fully qualified. The rules and placement manager guarantee that it is done. It 
is guaranteed as it is needed for parent rules and the create flag checks run 
by the rules.
   
   The other point to make is that the application should be rejected if the 
queue does not exist and no placement rules are configured. We should never try 
to create a queue without the placement rules in place. Allowing random queues 
to be created on submit could easily work around quotas etc and limits what an 
administrators can do to manage the cluster.
   As a workaround for this case if the queue does not exist and we do not have 
rules in place we should exit placement and reject (after line 116 in the 
original file):
   ```
   if schedulingQueue == nil && !psc.placementManager.IsInitialised() {
       return fmt.Errorf("application cannot be submitted to non existing queue 
%s for application %s", 
           schedulingApp.ApplicationInfo.QueueName, appID)
   }
   ```
   A non code change would be to add this to the config:
   ```
      placementrules:
       - name: provided
         create: false
   ```


----------------------------------------------------------------
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:
[email protected]


Reply via email to