• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zeeke / sriov-cni / 12802984914
40%
master: 46%

Build:
Build:
LAST BUILD BRANCH: us/lock-file-integration-test
DEFAULT BRANCH: master
Ran 16 Jan 2025 05:58AM UTC
Jobs 1
Files 10
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Jan 2025 05:56AM UTC coverage: 40.146% (+0.2%) from 39.956%
12802984914

push

github

zeeke
Lock PCI allocated file

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 <apanatto@redhat.com>

7 of 45 new or added lines in 3 files covered. (15.56%)

39 existing lines in 3 files now uncovered.

550 of 1370 relevant lines covered (40.15%)

2.11 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
70.07
1.13% pkg/config/config.go
10
0.0
0.0% cmd/sriov/main.go
26
46.38
0.0% pkg/utils/pci_allocator.go

Uncovered Existing Lines

Lines Coverage ∆ File
4
46.38
0.0% pkg/utils/pci_allocator.go
16
0.0
0.0% cmd/sriov/main.go
19
70.07
1.13% pkg/config/config.go
Jobs
ID Job ID Ran Files Coverage
1 12802984914.1 16 Jan 2025 05:58AM UTC 10
40.15
GitHub Action Run
Source Files on build 12802984914
  • Tree
  • List 10
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #12802984914
  • 2f6d2f03 on github
  • Prev Build on us/ocpbugs-45028 (#12788177309)
  • Next Build on us/ocpbugs-45028 (#13441746227)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc