craigcondit commented on a change in pull request #365:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/365#discussion_r804384195
##########
File path: pkg/cache/external/scheduler_cache.go
##########
@@ -255,26 +246,25 @@ func (cache *SchedulerCache) UpdatePod(oldPod, newPod
*v1.Pod) error {
defer cache.lock.Unlock()
currState, ok := cache.podsMap[key]
- switch {
- // An assumed pod won't have Update/Remove event. It needs to have Add
event
- // before Update event, in which case the state would change from
Assumed to Added.
- case ok && !cache.isAssumedPod(key):
- if currState.Spec.NodeName != newPod.Spec.NodeName {
- log.Logger().Error("pod updated on a different node
than previously added to", zap.String("pod", key))
- log.Logger().Error("scheduler cache is corrupted and
can badly affect scheduling decisions")
- }
- if err = cache.updatePod(oldPod, newPod); err != nil {
- return err
+ if ok {
+ // pod exists and is assumed
+ if !cache.isAssumedPod(key) && currState.Spec.NodeName !=
newPod.Spec.NodeName {
Review comment:
See previous reply. Caches need to stay in sync with their original
data.
--
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]