Commit 5ccdd87
committed
ipam: Wait for ENI netlink iface before configuring ingress routes
In ENI IPAM mode the operator creates ENIs asynchronously, so at agent
startup the datapath can query netlink for the ifindex of the interface
owning a given MAC before that ENI's netlink interface has materialized.
Commit 60faea1 added waitForENI() precisely to defeat that race, but
it was only wired into the router path (reallocateRouterIPs). The ingress
path (allocateIngressIPs) calls RoutingInfo.Configure() with no such
guard, so when the ingress IP lives on a secondary ENI that has not shown
up yet, retrieveIfIndexFromMAC fails with "interface with MAC <mac> not
found". Unlike the router path, the ingress path only warns and swallows
the error, and there is no reconciler to retry it, so the missed route is
never reinstalled and the stray warning turns check-log-errors red.
Mirror the router guard into the ingress path: thread ctx into
allocateIngressIPs and, in the IPv4 ENI branch immediately before
Configure(), poll waitForENI on the ENI's PrimaryMAC. This is not
masking. If the ENI genuinely never appears, waitForENI returns after the
same bounded backoff, Configure() still fails, and the warning still
fires. Only the transient sub-8s async-creation window is absorbed, which
is exactly the window 60faea1 was written to close.
The Configure() call also runs in AlibabaCloud ENI mode, and waitForENI
just polls netlink for the MAC, so gate the wait on ENI or AlibabaCloud
rather than ENI alone, and do the same on the router path so the two stay
consistent. Raise the "interface not found" message from warn to error on
both paths, since it precedes a route configuration that is about to fail.
AIL:3
Signed-off-by: André Martins <andre@cilium.io>1 parent cb6b7d4 commit 5ccdd87
1 file changed
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
299 | 298 | | |
300 | | - | |
| 299 | + | |
301 | 300 | | |
302 | 301 | | |
303 | 302 | | |
| |||
425 | 424 | | |
426 | 425 | | |
427 | 426 | | |
428 | | - | |
| 427 | + | |
429 | 428 | | |
430 | 429 | | |
431 | 430 | | |
| |||
475 | 474 | | |
476 | 475 | | |
477 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
478 | 486 | | |
479 | 487 | | |
480 | 488 | | |
| |||
553 | 561 | | |
554 | 562 | | |
555 | 563 | | |
556 | | - | |
| 564 | + | |
557 | 565 | | |
558 | 566 | | |
559 | 567 | | |
| |||
0 commit comments