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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

use rate limiting queue with delaying for pod deletion events #2774

Merged
merged 1 commit into from May 9, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented May 9, 2023

What type of this PR

Examples of user facing changes:

  • Features
  • Bug fixes
  • Docs
  • Tests

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

馃 Generated by Copilot at 4becd66

Changed the pod controller to delay pod deletion events based on the pod's termination grace period or other criteria. This is to prevent network disruption caused by premature IP address deallocation.

馃 Generated by Copilot at 4becd66

Oh we are the Controller crew, we manage the pods and IPs
We don't want to cause a mess, we delay the deletes with ease
Heave away, heave away, heave away on the deletePodQueue
We respect the grace and state, we don't delete before it's due

HOW

馃 Generated by Copilot at 4becd66

  • Change the type of deletePodQueue field of the Controller struct to support delayed enqueuing of pod deletion events (link)
  • Modify the enqueueUpdatePod function to calculate a delay based on the pod's termination grace period and deletion timestamp and use it to enqueue the pod deletion event to the deletePodQueue with the AddAfter method (link)
  • Apply the same delay logic to stateful pods and virtual machine pods in the enqueueUpdatePod function by checking the pod's owner references and labels (link, link)

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

  • The code changes in controller.go and pod.go should be reviewed for potential bugs, formatting errors, and performance issues.
  • In controller.go, the addition of a new rate limiting queue with delaying interface may improve performance, but it should be tested thoroughly to ensure that it does not introduce any new bugs or issues.
  • In pod.go, the use of a delay variable to determine when to add a pod to the deletePodQueue may be prone to errors if the delay is not calculated correctly. This should be reviewed carefully to ensure that it works as intended.
  • The use of go routines in pod.go to enqueue pods for deletion may cause performance issues if there are too many go routines running at once. This should be monitored and optimized if necessary.
  • The logging statements in pod.go should be reviewed to ensure that they provide enough information to debug any issues that may arise.

@zhangzujian zhangzujian marked this pull request as ready for review May 9, 2023 07:59
@zhangzujian zhangzujian requested a review from oilbeater May 9, 2023 07:59
@zhangzujian zhangzujian merged commit 3b2b071 into kubeovn:master May 9, 2023
58 checks passed
@zhangzujian zhangzujian deleted the delay branch May 9, 2023 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants