Skip to content

Commit

Permalink
Continue on .flock files after glob to avoid a nasty error log. (#2645)
Browse files Browse the repository at this point in the history
* Continue on .flock files after glob to avoid a nasty error log.

* Add changelog.
  • Loading branch information
dragotin committed Mar 29, 2022
1 parent 7810180 commit a6732ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-flock-warning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Avoid warning about missing .flock files

These flock files appear randomly because of file locking. We can savely ignore them.

https://github.com/cs3org/reva/pull/2645
4 changes: 4 additions & 0 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ func (fs *Decomposedfs) ListStorageSpaces(ctx context.Context, filter []*provide

for i := range matches {
var err error
// do not investigate flock files any further. They indicate file locks but are not relevant here.
if strings.HasSuffix(matches[i], ".flock") {
continue
}
// always read link in case storage space id != node id
spaceID, nodeID, err = readSpaceAndNodeFromSpaceTypeLink(matches[i])
if err != nil {
Expand Down

0 comments on commit a6732ed

Please sign in to comment.