twosigma / Cook

Fair job scheduler on Kubernetes and Mesos for batch workloads and Spark
Apache License 2.0
338 stars 63 forks source link

Setting quota or share: non-positive values silently ignored #691

Open DaoWen opened 6 years ago

DaoWen commented 6 years ago

Posting to the /quota or /share endpoints with a resource value that's negative or zero doesn't result in the correct behavior.

With regard to #3 above, it might be worthwhile to do an audit of anywhere that loop is used in the codebase to check for similar logic errors. In this case, it appears that replacing the loop with mapcat or another higher-order function would result in clearer (and correct) code.

DaoWen commented 6 years ago

689 fixes the issues above for the /quota endpoint: