Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filesystem store now delays before deleting temp file
There was a rare condition that could happen where the store would atomically swap the temp file and the final location then delete the temp file immediately after. Normally this would be fine, however during a hardlink, the interal kernel command first queries the inode then creates a hardlink for the queried inode. If the file was not swapped yet and the inode was queried, it'll get the inode of the file about to be deleted, then if the file is deleted then the hardlink will use an inode that doesn't exist any more. This is solved by adding a 100ms delay. In testing 1ms would be enough on my 16 core testbench, but to give plenty of leeway we add a substantial delay. This is also incredibly hard to write a test for, since it was a flake condition and I don't have control over the innards of the `hardlink` command, so this is one of the rare conditions there is not a unit test for a bug, but it is documented now.
- Loading branch information