Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request help: error log "failed to delete pod from cache" #684

Closed
Donghui0 opened this issue Sep 15, 2021 · 3 comments · Fixed by #714
Closed

request help: error log "failed to delete pod from cache" #684

Donghui0 opened this issue Sep 15, 2021 · 3 comments · Fixed by #714
Assignees
Labels
good first issue Good for newcomers triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@Donghui0
Copy link
Contributor

Issue description

When the service version changes, the k8s RollingUpgrade is triggered. The controller will have an error log:
"error ingress/pod.go:130 failed to delete pod from cache {"error": pod not running"

image

Is there any influences ?

Environment

  • your apisix-ingress-controller version: v1.1
  • your Kubernetes cluster version: v1.16.6
@tokers tokers added the triage/needs-information Indicates an issue needs more information in order to work on it. label Sep 15, 2021
@tokers tokers self-assigned this Sep 15, 2021
@Donghui0
Copy link
Contributor Author

Donghui0 commented Sep 15, 2021

func (p *podCache) Delete(pod *corev1.Pod) error {
ip := pod.Status.PodIP
if len(ip) == 0 {
return ErrPodNoAssignedIP
}
p.Lock()
defer p.Unlock()
delete(p.nameByIP, ip)
return nil
}

To delete the cache, need to determine whether the IP of the POD exists.
However, deleting the POD will definitely trigger the CNI to remove the IP.
So, In the delete event, the POD IP does not exist. is there a problem with the logic of deleting podCache?

@tao12345666333 tao12345666333 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Sep 15, 2021
@gxthrj
Copy link
Contributor

gxthrj commented Sep 15, 2021

Good catch. PR is welcome.
I think we can remove this condition directly.

@gxthrj gxthrj added the good first issue Good for newcomers label Sep 15, 2021
@tao12345666333 tao12345666333 linked a pull request Oct 20, 2021 that will close this issue
4 tasks
@tao12345666333 tao12345666333 added this to To do in v1.4 Planning via automation Oct 20, 2021
@tao12345666333 tao12345666333 added this to the 1.4.0 milestone Oct 20, 2021
@tao12345666333
Copy link
Member

#714 has been merged, I think we can close this one. If you have any question please feel free to reopen it.

v1.4 Planning automation moved this from To do to Done Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants