-
Notifications
You must be signed in to change notification settings - Fork 493
fix: reorder cleanup sequence in node-cache teardown #690
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
base: master
Are you sure you want to change the base?
Conversation
The previous implementation removed the dummy interface before cleaning up iptables rules, which could leave orphaned iptables rules referencing the removed interface. This fix ensures proper cleanup order by: 1. First removing all iptables rules 2. Then removing the dummy interface This change prevents potential issues where iptables rules might reference a non-existent interface after teardown.
Welcome @zooneon! |
Hi @zooneon. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zooneon The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Rules created in initIptables don't reference the dummy interface, only the IP addresses which it is being assigned. Did you run into an issue which is fixed by this PR? Can you talk more about it? |
@Michcioperz , ah i'm sorry that my explanation wasn't clear enough. How i tested
And finally, i think it makes sense to delete them in the reverse order in which they were created. |
Ohh, yeah, I think I understand now. If the interface is deleted first, but rules are still there, there will be a short moment where the traffic is still kept on the node, because it will bypass the Kubernetes Service handling iptables rules; at the same time there will be no interface on the node those packets can go to, so they will go into the void. I was worried this could be related to an issue I'm fixing, and it is the same symptoms, but different amount of time and cause. |
yepp, i read PR(#689) that you created, and what i understand is, that PR is intended to address the issue of processes not being gracefully shutdown by deadlocks. (So pod will be terminated without tearing down logic to be done.) |
The previous implementation removed the dummy interface before cleaning up iptables rules, which could leave orphaned iptables rules referencing the removed interface. This fix ensures proper cleanup order by:
This change prevents potential issues where iptables rules might reference a non-existent interface after teardown.
I found this in my testing and confirmed that it was indeed causing errors.
When deleting or updating, the dummy interface is deleted first, causing a disconnect and DNS queries to fail.
I changed the order of the teardown logic and it worked without errors.