Skip to content
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

CI: golangci-lint out of memory #4851

Closed
medyagh opened this issue Jul 23, 2019 · 3 comments · Fixed by #4852
Closed

CI: golangci-lint out of memory #4851

medyagh opened this issue Jul 23, 2019 · 3 comments · Fixed by #4852
Labels
area/testing kind/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test.

Comments

@medyagh
Copy link
Member

medyagh commented Jul 23, 2019

we had this issue yesterday, for two PRs but it was flaky and not consistant error:

today I saw it in travis again : here https://travis-ci.org/kubernetes/minikube/jobs/562528986


goroutine 11121 [runnable]:
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll.func1(0xc0a63ed400)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:290
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:297 +0x11b
goroutine 11206 [semacquire]:
sync.runtime_SemacquireMutex(0xc0a63ed404, 0xc001d0f000)
	/home/travis/.gimme/versions/go1.12.5.linux.amd64/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc0a63ed400)
	/home/travis/.gimme/versions/go1.12.5.linux.amd64/src/sync/mutex.go:134 +0x109
sync.(*Once).Do(0xc0a63ed400, 0xc0a6500790)
	/home/travis/.gimme/versions/go1.12.5.linux.amd64/src/sync/once.go:40 +0x3b
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.(*action).exec(0xc0a63ed400)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:303 +0x50
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll.func1(0xc0a63ed400)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:291 +0x34
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:297 +0x11b

the error is reported in: it seems to be the root cause of the problem:
golangci/golangci-lint#483

@medyagh medyagh changed the title golangci-lint out of memory CI: golangci-lint out of memory Jul 23, 2019
@medyagh medyagh added the kind/bug Categorizes issue or PR as related to a bug. label Jul 23, 2019
@medyagh
Copy link
Member Author

medyagh commented Jul 23, 2019

The work arround for this issue is setting the "GOGC" env variable
https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint

however we have already set that in Makefile

	GOGC=${GOLINT_GOGC} ./out/linters/golangci-lint run \
	  --concurrency ${GOLINT_JOBS} \
	  --deadline 4m \
	  --build-tags "${MINIKUBE_INTEGRATION_BUILD_TAGS}" \
	  --enable goimports,gocritic,golint,gocyclo,interfacer,misspell,nakedret,stylecheck,unconvert,unparam \
	  --exclude 'variable on range scope.*in function literal|ifElseChain' \
	  ./...

so its either not going through or it is still too high number and we need to lower it.

@medyagh
Copy link
Member Author

medyagh commented Jul 23, 2019

given that it has direct coronation between number of lint files, it could be related to the new files for site and translation.

we probably need to exclude more not-lintable files to be more efficient.

@medyagh medyagh added kind/flake Categorizes issue or PR as related to a flaky test. area/testing labels Jul 23, 2019
@afbjorklund
Copy link
Collaborator

Could run it on v1.2.0 to compare ?

Someone bored could make a matrix:

  • minikube version
  • golangci-lint version
  • jobs (default: nproc)
  • gogc (default: 100)

And note runtime and cpu/ram usage. It used to run in 30 secs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants