Skip to content

x/tools/gopls: mod cache refresh timers run after view shutdown #67865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gopherbot opened this issue Jun 6, 2024 · 3 comments
Closed

x/tools/gopls: mod cache refresh timers run after view shutdown #67865

gopherbot opened this issue Jun 6, 2024 · 3 comments
Assignees
Labels
gopls Issues related to the Go language server, gopls. 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

Comments

@gopherbot
Copy link
Contributor

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/test/integration/modfile" && test == "TestNewDepWithUnusedDep/default/default"

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestNewDepWithUnusedDep/default/default
goroutine profile: total 8
1 @ 0x4345d1 0x46b6fd 0x5d4f91 0x5d4dc5 0x5d1866 0xe25870 0xe254e2 0x531d5f 0x471e41
#	0x46b6fc	runtime/pprof.runtime_goroutineProfileWithLabels+0x1c				/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mprof.go:844
#	0x5d4f90	runtime/pprof.writeRuntimeProfile+0xb0						/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:734
#	0x5d4dc4	runtime/pprof.writeGoroutine+0x44						/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:694
#	0x5d1865	runtime/pprof.(*Profile).WriteTo+0x145						/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:329
#	0xe2586f	golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1.1+0x6f	/home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/gopls/internal/test/integration/runner.go:198
#	0xe254e1	golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1+0xf41	/home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/gopls/internal/test/integration/runner.go:252
#	0x531d5e	testing.tRunner+0xfe								/home/swarming/.swarming/w/ir/x/w/goroot/src/testing/testing.go:1595
...
#	0x46e614	syscall.syscall6+0x34						/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/sys_openbsd3.go:46
#	0x483804	syscall.wait4+0x44						/home/swarming/.swarming/w/ir/x/w/goroot/src/syscall/zsyscall_openbsd_amd64.go:43
#	0x480d04	syscall.Wait4+0x24						/home/swarming/.swarming/w/ir/x/w/goroot/src/syscall/syscall_bsd.go:144
#	0x4b420c	os.(*Process).wait+0x6c						/home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec_unix.go:43
#	0x577b84	os.(*Process).Wait+0x44						/home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec.go:134
#	0x577b7c	os/exec.(*Cmd).Wait+0x3c					/home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec/exec.go:890
#	0x6f0884	golang.org/x/tools/internal/gocommand.runCmdContext.func4+0x24	/home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/internal/gocommand/invoke.go:382

    runner.go:199: closing the sandbox: error(s) cleaning sandbox: cleaning modcache: <nil>; removing files: unlinkat /home/swarming/.swarming/w/ir/x/t/gopls-test-3845998539/TestNewDepWithUnusedDep/default/default: directory not empty
--- FAIL: TestNewDepWithUnusedDep/default/default (32.85s)

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 6, 2024
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jun 6, 2024
@gopherbot gopherbot added this to the Unreleased milestone Jun 6, 2024
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/gopls/internal/test/integration/modfile" && test == "TestNewDepWithUnusedDep/default/default"
2024-06-06 18:30 x_tools-go1.21-openbsd-amd64 tools@5e0f1d8d release-branch.go1.21@48103d97 x/tools/gopls/internal/test/integration/modfile.TestNewDepWithUnusedDep/default/default (log)
=== RUN   TestNewDepWithUnusedDep/default/default
goroutine profile: total 8
1 @ 0x4345d1 0x46b6fd 0x5d4f91 0x5d4dc5 0x5d1866 0xe25870 0xe254e2 0x531d5f 0x471e41
#	0x46b6fc	runtime/pprof.runtime_goroutineProfileWithLabels+0x1c				/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mprof.go:844
#	0x5d4f90	runtime/pprof.writeRuntimeProfile+0xb0						/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:734
#	0x5d4dc4	runtime/pprof.writeGoroutine+0x44						/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:694
#	0x5d1865	runtime/pprof.(*Profile).WriteTo+0x145						/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/pprof/pprof.go:329
#	0xe2586f	golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1.1+0x6f	/home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/gopls/internal/test/integration/runner.go:198
#	0xe254e1	golang.org/x/tools/gopls/internal/test/integration.(*Runner).Run.func1+0xf41	/home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/gopls/internal/test/integration/runner.go:252
#	0x531d5e	testing.tRunner+0xfe								/home/swarming/.swarming/w/ir/x/w/goroot/src/testing/testing.go:1595
...
#	0x46e614	syscall.syscall6+0x34						/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/sys_openbsd3.go:46
#	0x483804	syscall.wait4+0x44						/home/swarming/.swarming/w/ir/x/w/goroot/src/syscall/zsyscall_openbsd_amd64.go:43
#	0x480d04	syscall.Wait4+0x24						/home/swarming/.swarming/w/ir/x/w/goroot/src/syscall/syscall_bsd.go:144
#	0x4b420c	os.(*Process).wait+0x6c						/home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec_unix.go:43
#	0x577b84	os.(*Process).Wait+0x44						/home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec.go:134
#	0x577b7c	os/exec.(*Cmd).Wait+0x3c					/home/swarming/.swarming/w/ir/x/w/goroot/src/os/exec/exec.go:890
#	0x6f0884	golang.org/x/tools/internal/gocommand.runCmdContext.func4+0x24	/home/swarming/.swarming/w/ir/x/w/targetrepo1827131465/internal/gocommand/invoke.go:382

    runner.go:199: closing the sandbox: error(s) cleaning sandbox: cleaning modcache: <nil>; removing files: unlinkat /home/swarming/.swarming/w/ir/x/t/gopls-test-3845998539/TestNewDepWithUnusedDep/default/default: directory not empty
--- FAIL: TestNewDepWithUnusedDep/default/default (32.85s)

watchflakes

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.16.0 Jun 7, 2024
@findleyr findleyr changed the title x/tools/gopls/internal/test/integration/modfile: TestNewDepWithUnusedDep/default/default failures x/tools/gopls: mod cache refresh timers run after view shutdown Jun 7, 2024
@findleyr
Copy link
Member

findleyr commented Jun 7, 2024

This flake demonstrates that with https://go.dev/cl/590377, I exacerbated an existing problem by always scheduling a module cache refresh when views are created.

As a result, it is more likely that timers run after view shutdown in tests, holding on to resources and preventing cleanup on windows.

@findleyr findleyr self-assigned this Jun 7, 2024
@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/591315 mentions this issue: gopls/internal/cache: stop module cache refresh on view shutdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. 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.
Projects
Archived in project
Development

No branches or pull requests

2 participants