Description
#!watchflakes
post <- `unexpected files left in tmpdir: .*go-build`
The logs for the windows-amd64-2012
builder (and only that builder, as far as I can tell — CC @alexbrainman) show many flakes at the end of the cmd/go
tests, of the form:
2019/03/12 20:59:55 unexpected files left in tmpdir: [go-build421361794 go-build697015714]
(https://build.golang.org/log/177e49c04af866fec137d316334a80a1a5137376)
The test otherwise seems to pass.
That log line comes from here (CC @ianlancetaylor):
Line 285 in 1650f1b
The fact that the temporary directories start with the prefix go-build
suggests that they come from here:
go/src/cmd/go/internal/work/action.go
Line 227 in 820ad17
I'm not sure what to make of the fact that those flakes are specific to the one builder. Perhaps there is a kernel quirk on that specific version of Windows that causes it not to clean up completely on exit?
(CC @jayconrod)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Activity
alexbrainman commentedon Mar 13, 2019
Strange. I cannot explain why
windows-amd64-2012
builder is different from others.I did not debug this failure. But, generally, you cannot delete directory, if some process have open files in that directory. Same if some process current directory is set to directory being deleted or any directory under.
I suppose someone needs to reproduce this, and then somehow debug this. Once we know how it happens, we might understand better why only
windows-amd64-2012
have the problem.Alex
bradfitz commentedon Apr 5, 2019
I spent some time debugging this with gomote and logging in cmd/go TestMan & temporary hooks/logs in io/ioutil.TempDir.
It seems that whatever is making those directories that don't get deleted do NOT come from the same process that runs the test (running the TestMain). I see tons of temp dirs get created from the cmd/go (TestMain) process, but not the ones that cause failures, so I suspect it's a child process (where my logging hook isn't installed) that is creating the directory.
Time for more logging, I guess.
alexbrainman commentedon Apr 5, 2019
I also would not be surprised that this bug is not Go related.
Maybe antivirus is running (or some other Windows program, for example, something that indexes files on disk) and locking our executables at random times. If windows-amd64-2012 computer is configured in a slightly different way than others, that would explain why we see this problem on windows-amd64-2012 only.
Alex
gopherbot commentedon Apr 11, 2019
Change https://golang.org/cl/171764 mentions this issue:
cmd/go: log failures to remove workdir
bcmills commentedon Apr 11, 2019
I'm getting tired of builder flakes. Time to find this and either fix it or work around it.
cmd/go: log failures to remove workdir
alexbrainman commentedon Apr 12, 2019
I did some exercise #25965 (comment) maybe related to this issue. And I can see vastly different results between my Windows 7 and Windows 10 computers. Maybe similar effect can explain what we see with windows-amd64-2012 builder.
Alex
bradfitz commentedon Apr 12, 2019
With Bryan's latest debugging CL, they log
Access is denied
now:https://build.golang.org/log/47129350051d5b9c0600f9421c2680d7610bd4cd
bcmills commentedon Apr 12, 2019
So perhaps we should check for the
Access is denied
error code specifically and retry (a few times or for a short while in a loop) before we give up and return with the directory leaked.We probably don't want to stall forever if the user has a really slow antivirus installed or something, but a wait of ~500ms or so seems reasonable to me. (Any opinions from the other folks following?)
bradfitz commentedon Apr 12, 2019
Retrying for a bit on
Access is denied
SGTM. Another option might be to only do it if we're in a test, but that might be surprising.16 remaining items
gopherbot commentedon Aug 24, 2023
Timed out in state WaitingForInfo. Closing.
(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)