Closed navytux closed 1 year ago
Maybe https://github.com/hanwen/go-fuse/issues/472 is related.
Reliable way to reproduce:
(neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/github.com/hanwen/go-fuse/fs$ go test -run TestReaddirplusParallel -count 1000 -failfast
--- FAIL: TestReaddirplusParallel (0.03s)
mem_test.go:295: got 99 want 100
FAIL
exit status 1
FAIL github.com/hanwen/go-fuse/fs 1.256s
(neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/github.com/hanwen/go-fuse/fs$ go test -run TestReaddirplusParallel -count 1000 -failfast
--- FAIL: TestReaddirplusParallel (0.04s)
mem_test.go:295: got 98 want 100
FAIL
exit status 1
FAIL github.com/hanwen/go-fuse/fs 8.927s
(neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/github.com/hanwen/go-fuse/fs$ go test -run TestReaddirplusParallel -count 1000 -failfast
--- FAIL: TestReaddirplusParallel (0.04s)
mem_test.go:295: got 95 want 100
FAIL
exit status 1
FAIL github.com/hanwen/go-fuse/fs 10.289s
go-fuse v2.3.0-11-g255ab74
There is another element of randomization in the hashmap iteration order. (sigh).
See https://github.com/golang/go/commit/3be4d95731a17073afb1f69bde264eecbdfa32bb
this change is old, but testing suggests this is still the method used. There are 8 different iteration orders. With the current approach in go-fuse you have to be somewhat unlucky for entries to move around between READDIRPLUS responses, but it's essentially the same problem as in #391
plan: store children as
childrenMap map[string]int
children []struct {name string; inode*Inode}
this could also provide for persistent readdir semantics, by storing the changeCounter in the children list, and handing that out as a readdir cookie.
Thanks for the fix.
From https://github.com/hanwen/go-fuse/issues/351#issuecomment-1583070074 :
TestReaddirplusParallel: