[BUG] Race condition: OCI caching #580
Labels
bug
Something isn't working
help wanted
Extra attention is needed
pinned
Should not be removed as stale over time
Describe the bug
The host has a race condition in oci.rs: on a cache miss, the host will download the parcheezy bytes and then cache them to disk. While the host is writing the bytes to disk, if a subsequent request to start the same provider is received, the host will count this as a cache hit and return the cache path. The host will then fail to start the provider, since the bytes haven't been fully written to disk yet.
To Reproduce
Note I haven't confirmed 100% this is happening, but it seems like the most likely cause. To reproduce, simply issue two provider start commands with the same OCI reference and different link names concurrently. When the race condition is triggered, you'll see this error message from the host:
Expected behavior
The host should either block subsequent provider starts until after the current request has been satisfied, or the internal NIF code should somehow block on filesystem access to the cache path...
Environment (please complete the following information)
The text was updated successfully, but these errors were encountered: