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
Interrupt go test or any other build command using ^C or with kill -SIGINT.
It's easy to reproduce this by setting GOTMPDIR to a local directory and then running a test that sleeps for a few seconds.
What did you expect to see?
No temporary go-build directories are left behind.
What did you see instead?
Directories with names like go-build312263156 are left behind.
go test should trap the signal, delete the work directory, and exit gracefully. It should not trim the build cache or do anything else that might take a long time (which it normally does when exiting).
Fixing this would be non-trivial: we'll need to plumb contexts through to network, build, and test operations to handle the cancellation. We probably want to do that anyway though for tracing.
we'll need to plumb contexts through to network, build, and test operations to handle the cancellation
Will contexts be enough? They do provide cancellation, but there won't be a way for the main goroutine to wait for the cleanup process (deleting temporary directories) to finish.
Cleaning up build directories happens in base.Exit, which is run from the main goroutine. I think that would be mostly unchanged. We'd just get there faster by cancelling anything that takes a long time.
Originally reported in golang/vscode-go#152.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Interrupt
go test
or any other build command using^C
or withkill -SIGINT
.It's easy to reproduce this by setting
GOTMPDIR
to a local directory and then running a test that sleeps for a few seconds.What did you expect to see?
No temporary
go-build
directories are left behind.What did you see instead?
Directories with names like
go-build312263156
are left behind.go test
should trap the signal, delete the work directory, and exit gracefully. It should not trim the build cache or do anything else that might take a long time (which it normally does when exiting).Fixing this would be non-trivial: we'll need to plumb contexts through to network, build, and test operations to handle the cancellation. We probably want to do that anyway though for tracing.
cc @hakim @bcmills @matloob
The text was updated successfully, but these errors were encountered: