dSQ icon indicating copy to clipboard operation
dSQ copied to clipboard

Potential race condition w/ NFS

Open liningpan opened this issue 1 year ago • 0 comments

Thanks for creating dSQ!

If I understand correctly, when dSQ saves a job status entry it assumes that appending to a file is atomic. However, this is not true on NFS filesystems. Although unlikely, it is theoretically possible corrupt a status file without additional locking (i.e. flock/fcntl). I just want to raise this potential issue since Grace now uses NFSv3 for home folders and scratch.

https://www.man7.org/linux/man-pages/man2/open.2.html

O_APPEND may lead to corrupted files on NFS filesystems if more than one process appends data to a file at once. This is because NFS does not support appending to a file, so the client kernel has to simulate it, which can't be done without a race condition.

https://github.com/ycrc/dSQ/blob/2d373343d8e6c0cd6cbddcee18709c417faa748b/dSQBatch.py#L121-L129

liningpan avatar Apr 04 '23 19:04 liningpan