Skip to content

Conversation

bimmlerd
Copy link
Member

@bimmlerd bimmlerd commented Jun 6, 2023

Once this PR is merged, you can update the PR labels via:

for pr in 25450 25419; do contrib/backporting/set-labels.py $pr done 1.12; done

or with

make add-labels BRANCH=v1.12 ISSUES=25450,25419

bimmlerd added 4 commits June 6, 2023 11:23
[ upstream commit d8a0be6 ]

[backporter notes:
 1. some conflicts due to moved files
 2. had to mildly adapt the fakeDatapath to keep a ptr to
 fakeNodeHandler instead of the interface]

Return pointer to implementing struct instead of implemented interface
from the constructor, as is commonly considered idiomatic Go. The
constructor is already in a linux-specific package. To ensure that we
really do implement the interface we want, add a static type check in
form of a variable assignment. As a side-effect, this allows us to drop
a number of type assertions in tests.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
[ upstream commit 8294624 ]

[backporter notes: conflicts due to moved files/import paths]

The NodeHandler interface is too large, as can be seen in various
implementations which are only implementing a subset of methods. This
patch splits off the NodeID handling part, and removes the stub methods
from noop implementations.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
[ upstream commit 1aa06c6 ]

[ backporter notes: conflicts due to moved files ]

The NodeHandler interface still contains two different concepts. Remove
the NodeNeighbor discovery/handling from it, and delete the different
stub implementations.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
[ upstream commit c8598f8 ]

[ backporter notes:
1. different way of subscribing to NodeManager
2. conflicts due to moved files/import paths ]

The reason the WireGuard agent node event handling was contained within
the linuxNodeHandler code was routing, which is no longer the case. In
addition, entangling the two leads to a deadlock, as diagnosed in GitHub
issue cilium#24574.

This patch thus implements NodeHandler for the WireGuard agent, and
subscribes to the NodeManager itself. That way, the wait cycle of the
deadlock is broken, as the linuxNodeHandler doesn't acquire the IPCache
lock while holding its lock.

From the perspective of the agent, the invocations of the callbacks
change insofar that previously, only once the linuxNodeHandler
considered itself "initialised" it would forward node events.
Specifically, this excluded the initial sync of nodes performed on
subscribe. However, I didn't see a reason to specifically replicate this
behaviour.

Suggested-by: Sebastian Wicki <sebastian@isovalent.com>
Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
@bimmlerd bimmlerd requested a review from a team as a code owner June 6, 2023 09:28
@bimmlerd bimmlerd added kind/backports This PR provides functionality previously merged into master. backport/1.12 labels Jun 6, 2023
@bimmlerd bimmlerd requested a review from gandro June 6, 2023 09:29
@bimmlerd bimmlerd changed the title v1.12 Backports 2023-06-06 [v1.12] Author backport of WG Node handler and dependent PR Jun 6, 2023
@bimmlerd
Copy link
Member Author

bimmlerd commented Jun 6, 2023

/test-backport-1.12

Job 'Cilium-PR-K8s-1.16-kernel-4.9' failed:

Click to show.

Test Name

K8sPolicyTest Basic Test checks all kind of Kubernetes policies

Failure Output

FAIL: Unable to restart unmanaged pods with 'kubectl -n kube-system delete pods coredns-8cfc78c54-h77nr': Exitcode: 1 

Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.16-kernel-4.9/16/

If it is a flake and a GitHub issue doesn't already exist to track it, comment /mlh new-flake Cilium-PR-K8s-1.16-kernel-4.9 so I can create one.

Then please upload the Jenkins artifacts to that issue.

@gandro
Copy link
Member

gandro commented Jun 12, 2023

@gandro
Copy link
Member

gandro commented Jun 12, 2023

/test-1.16-4.9

@bimmlerd
Copy link
Member Author

Marked as a release blocker, since this is a regression fix (see #25419 (comment)).

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 12, 2023
@gandro gandro merged commit 642acc3 into cilium:v1.12 Jun 12, 2023
@bimmlerd bimmlerd deleted the pr/v1.12-backport-2023-06-06 branch June 12, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/backports This PR provides functionality previously merged into master. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants