Open connorsmith256 opened 1 year ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this has been closed too eagerly, please feel free to tag a maintainer so we can keep working on the issue. Thank you for contributing to wasmCloud!
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)