-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
loader: remove ctx from uncancellable functions
Loading bpf objects used to be done by iproute2, where propagating ctx to the exec.Cmd invocations made sense, since realistically any shellout can hang for arbitrary reasons. Now the loader is fully hosted in the agent process, this no longer makes sense. Once we're blocked in a bpf() syscall, e.g. for loading a program, the verifier can be interrupted by sending a signal to the calling thread. Since the Go runtime routinely sends these signals under normal operation, ebpf-go will retry a few times when bpf() returns EINTR. The API currently doesn't expose a way to cancel program loading/verification, and there's no clear benefit to doing so in the first place. Verification is relatively lightweight compared to datapath compilation, so interrupting it during teardown is of questionable benefit. The agent doesn't expect it to be interruptible, it's bound to leave endpoints in an undefined state. This commit introduces the assumption that, once endpoint loading/attachment is kicked off (after compilation), it cannot be cancelled. This is reflected in the interface exposed to the rest of the system, by removing the ctx parameter on many methods. Only compilation can be interrupted, since it can take a long time on some systems, especially lower-spec. Signed-off-by: Timo Beckers <timo@isovalent.com>
- Loading branch information
Showing
9 changed files
with
26 additions
and
34 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
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