You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
posixfs tries to stat the lockfile for every entry in a file listing #2745
func (n *Node) hasLocks(ctx context.Context) bool {
for _, p := range n.LockFilePaths() {
if _, err := os.Stat(p); err == nil { // STAT !!!
return true
}
}
return false
}
this makes a stat call for every child in the dirlisting.
on a network filesystem like leilfs listing 1000 files looks like this:
when always returning false instead of making the stat call:
In the back, there are two pods with different load. the sfsmount process produces constant load. using an nfs ganesha mount might be better for our use case, but I ran into problems
The problem isn't limited to posixfs, decomposed* also tries to stat the lockfile of each entry. For Posixfs it's twice as severe however because it considers lockfiles both in the metadata dir and the actual file tree, so it's two stats instead of one for each dir entry.
The file tree locks are only relevant if collaborative mode is enabled however, I'll open a pull request to disable them if it's off.
For "our" locks we could consider moving the lock state into the file metadata which is nicely cached in nats and is available at that point anyway. That leaves the question how external applications could determin wheter a file is locked or not but that could be solved by adding something like an opencloud lock command, for example.
Activity
aduffeck commentedon May 13, 2026
The problem isn't limited to
posixfs,decomposed*also tries to stat the lockfile of each entry. For Posixfs it's twice as severe however because it considers lockfiles both in the metadata dir and the actual file tree, so it's two stats instead of one for each dir entry.The file tree locks are only relevant if collaborative mode is enabled however, I'll open a pull request to disable them if it's off.
For "our" locks we could consider moving the lock state into the file metadata which is nicely cached in nats and is available at that point anyway. That leaves the question how external applications could determin wheter a file is locked or not but that could be solved by adding something like an
opencloud lockcommand, for example.