containerd / nerdctl

contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...
Apache License 2.0
7.63k stars 565 forks source link

`networks` related code is racy #3086

Open apostasie opened 2 weeks ago

apostasie commented 2 weeks ago

Description

For some reason, network tests are very racy on my rig.

Just taking network_remove_linux_test, I get several different conditions quite fast:

From a cursory reading, it feels to me like number 1 is somewhere in netutils making assumptions about the availability of objects.

Number 2 is probably also in netutils - seems to me like racyness between checking that a network exist and a later operation that depends on reading the config. Could be that for certain operation we do not use filelock (properly).

Number 3 is more worrisome.

Steps to reproduce the issue

go test

Describe the results you received and expected

Fail 1 out of 10 times with a variety of different reasons.

What version of nerdctl are you using?

1.7.6

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response