Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/cmd/gopls: deadlock after deleting file #32368
After deleting a file from a package and editing another file in the package I immediately get stuck with "no room in queue". The stack trace (pasted below) shows a goroutine blocking on a wait group at parse.go:92. It appears the surrounding code has a case where it returns without decrementing the wait group, which is probably causing this deadlock. The other side of the deadlock is cache/view.go:299 trying to acquire the view's mutex.
Fixes golang/go#32368 There were several returns in this function that could leak both the wg.Done() and <-ioLimit. This refactors them into defers close to their counterparts. Additionally I refactored the function to favor early returns over nested if statements.