path/filepath: WalkFunc is called with a "file does not exist" error if a file is deleted between readdirnames and lstat (inside walk). #24959
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?% go version
go version go1.10 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?% go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/amistry/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/amistry/go-src"
GORACE=""
GOROOT="/home/amistry/go"
GOTMPDIR=""
GOTOOLDIR="/home/amistry/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build740843021=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Call filepath.Walk on a directory where files are being constantly deleted (and added).
What did you expect to see?
No errors.
What did you see instead?
"file does not exist" errors. If a file doesn't exist, why are you telling me about it?
I guess this is more of a question of semantics. If a file a deleted between the directory listing and lstat, should the caller be told, or should this case be hidden? If a file is deleted before the readdirnames, then there's no error. If a file is added between readdirnames and lstat, it is hidden from the caller. I'd argue that hiding the error is a more consistent and expected.
The text was updated successfully, but these errors were encountered: