-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When running on heavy a load, sriov-cni might be invoked multiple times by the kubelet or the container runtime. In these situations, it might happen that a `cmdAdd` or a `cmdDel` run on the same device that is still handled by a `cmdDel` instance (e.g. when the IPAM plugin takes a long time to finish). This commit adds a Lock mechanism around the `/var/lib/cni/sriov/<PCI>` address, to avoid two or more instances handling the same the device. The lock is based on `flock` [1] using the `O_CLOEXEC` flag, which garantees that the lock is released when the process finishes. [1] https://linux.die.net/man/2/flock Signed-off-by: Andrea Panattoni <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 additions
and
2 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