x/tools/go/packages: golist driver leaks a go command invocation #65180
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Looking at the following improper shutdown in gopls:
https://build.golang.org/log/bf996ae51d525c51272637629e8dfe6ed4cb79a6
Investigating the goroutine dump there, it looks like the golist driver doesn't handle cancellation properly, and as a result leaks a goroutine that is running the Go command (which, in turn, prevents clean up of the module cache).
Specifically, the driver is here: https://cs.opensource.google/go/x/tools/+/master:go/packages/golist.go;l=154;drc=f60f2e6aa42c945111053771ea53938694791d83
But note that there are early returns that don't await that WaitGroup. My guess is that there's a race when the context is cancelled.
CC @matloob @adonovan
The text was updated successfully, but these errors were encountered: