Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LegacyHashFunction = false
Functions ¶
func GCLockFileDir ¶ added in v0.2.0
GCLockFileDir removes stale lock files from dirPath (recursively).
Lock files accumulate because Unlock never deletes them. A file is removed only when all of these hold:
- its mtime is older than minAge (skips hot locks and makes the pass cheap over huge directories: the mtime check happens before any lock attempt);
- GC can acquire an exclusive flock on it via TryLock (so it is not held by anyone else right now).
This is safe against the flock+unlink race only in combination with the inode-safe acquire path (see file_locker.go): a concurrent acquirer that opened the file just before GC unlinked it will detect the dead inode (Nlink==0) and retry on a freshly created file.
Errors for individual files are collected and returned joined; a single bad file does not abort the whole pass. Files that disappear concurrently are ignored.
Types ¶
Click to show internal directories.
Click to hide internal directories.