craigcondit commented on a change in pull request #365:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/365#discussion_r802130542
##########
File path: pkg/cache/context.go
##########
@@ -271,13 +284,7 @@ func (ctx *Context) updatePodInCache(oldObj, newObj
interface{}) {
func (ctx *Context) filterPods(obj interface{}) bool {
switch obj := obj.(type) {
case *v1.Pod:
- // if a terminated pod is added to cache, it will
- // add requested resource to the cached node, causing
- // the node uses more resources that it actually is,
- // this can only be fixed after the pod is removed.
- // (trigger the delete pod)
- return utils.GeneralPodFilter(obj) &&
- !utils.IsPodTerminated(obj)
+ return utils.GeneralPodFilter(obj)
Review comment:
This logic gets moved to `addPodToCache()` / `updatePodInCache()` as we
DO want to allow terminated pods to flow through to `removePodFromCache()`. The
old logic filtered these out from all methods, resulting in leaks of terminated
pods.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]