forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
datapath,endpoint: explicitly remove TC filters during endpoint teardown
[ upstream commit 6633ca8 ] [ backporter notes: Fixed conflicts in pkg/endpoint/endpoint.go due to the fact that v1.15 uses `!option.Config.DryMode` rather than `!e.isProperty(PropertyFakeEndpoint)` ] Prior to this commit, we left it up to the kernel to clean up tc attachments when the CNI finally removes the veth when a Pod goes away. This leaves a window of time where an endpoint's tc programs can potentially be invoked after the endpoint's internal tail call maps have already been cleared and the endpoint has been removed from the endpoint map and ipcache, resulting in undefined behaviour. This patch clearly defines the endpoint teardown sequence as follows: - remove (endpoint) routes - set the interface down - detach tc(x) hooks - remove endpoint from endpoint map - remove endpoint policy program(s) - delete conntrack map pins - remove policy prog array map pin - remove internal tail call map pin - remove custom calls map pin This puts the agent more in control of the teardown sequence and will allow us to reason better about failures related to missed tail calls and other flakes. Signed-off-by: Timo Beckers <[email protected]> Signed-off-by: Sebastian Wicki <[email protected]>
- Loading branch information
Showing
5 changed files
with
104 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters