optuna.storages.journal.JournalFileSymlinkLock
- class optuna.storages.journal.JournalFileSymlinkLock(filepath)[source]
Lock class for synchronizing processes for NFSv2 or later.
On acquiring the lock, link system call is called to create an exclusive file. The file is deleted when the lock is released. In NFS environments prior to NFSv3, use this instead of
JournalFileOpenLock
.- Parameters:
filepath (str) – The path of the file whose race condition must be protected.
Methods
acquire
()Acquire a lock in a blocking way by creating a symbolic link of a file.
release
()Release a lock by removing the symbolic link.