Skip to content

Deadline exceeded on MacOS #293

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
gdankov opened this issue Nov 15, 2018 · 6 comments
Closed

Deadline exceeded on MacOS #293

gdankov opened this issue Nov 15, 2018 · 6 comments

Comments

@gdankov
Copy link

gdankov commented Nov 15, 2018

Greetings,

After upgrading to version 1.12.2 (from 1.10.2) using brew, golangci-lint hangs for a long time until the deadline eventually exceeds.

I am using MacOS Mojave; Version 10.14.1 (18B75)

Please include the following information:

  1. Version of golangci-lint: golangci-lint --version (or git commit if you don't use binary distribution)

golangci-lint has version 1.12.2 built from 898ae4d on 2018-11-11T06:43:11Z

  1. Config file: cat .golangci.yml
run:
  # which dirs to skip: they won't be analyzed;
  skip-dirs:
    - vendor

linters-settings:
  govet:
    # report about shadowed variables
    check-shadowing: true
  gocyclo:
    # minimal code complexity to report
    min-complexity: 10
  maligned:
    # print struct with more effective memory layout
    suggest-new: true
  lll:
    line-length: 512

linters:
  enable-all: true
  disable:
    - gocritic
    - gochecknoglobals
    - scopelint
    - gochecknoinits
    - typecheck
    - goconst

issues:
  exclude-use-default: true
  exclude:
      - G402  # Temporarily do not look for bad TLS connection settings.

  # Maximum issues count per one linter. Set to 0 to disable.
  max-per-linter: 0

  # Maximum count of issues with the same text. Set to 0 to disable
  max-same: 0

  # Show only new issues
  new: false
  1. Go environment: go version && go env
go version go1.10.3 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/.../Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/.../go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.3/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/4k/14xvlv8s47j2s0tskc0ht4240000gn/T/go-build379266119=/tmp/go-build -gno-record-gcc-switches -fno-common"
  1. Verbose output of running: golangci-lint run -v
INFO [config_reader] Config search paths: [./ /Users/.../go/src/code.cloudfoundry.org/eirini /Users/.../go/src/code.cloudfoundry.org /Users/.../go/src /Users/.../go /Users/... /Users /]
INFO [config_reader] Used config file .golangci.yml
INFO Gocritic enabled checks: [appendAssign assignOp caseOrder dupArg dupBranchBody dupCase flagDeref ifElseChain regexpMust singleCaseSwitch sloppyLen switchTrue typeSwitchVar underef unlambda unslice defaultCaseOrder]
INFO [lintersdb] Active 22 linters: [deadcode depguard dupl errcheck gocyclo gofmt goimports golint gosec govet ineffassign interfacer lll maligned megacheck misspell nakedret prealloc structcheck unconvert unparam varcheck]
INFO Memory: 601 samples, avg is 69.7MB, max is 69.7MB
INFO Execution took 1m0.005106025s
INFO [loader] Go packages loading at mode load deps types and syntax took 12m44.411750704s
INFO [loader] SSA repr building timing: packages building 46.431281ms, total 2.027687669s
INFO [loader] SSA for megacheck repr building timing: packages building 57.741071ms, total 2.085012097s
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [] for 565ns
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [] for 275ns
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [] for 259ns
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [] for 239ns
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [] for 392ns
INFO [loader] Packages that do not compile: [code.cloudfoundry.org/eirini/recipe/packs/cf/fixtures/go-app code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/launcher [code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/launcher.test] code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/launcher/fixtures/hello code.cloudfoundry.org/eirini/recipe/packs/cf/cmd/exporter code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/buildpackrunner [code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/buildpackrunner.test] code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/buildpackrunner_test [code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/buildpackrunner.test] code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/protocol code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/builder [code.cloudfoundry.org/eirini/launcher/buildpackapplifecycle/builder.test]]
INFO [runner] worker.2 took 9.709µs
INFO [runner] worker.1 took 8.055µs
INFO [runner] worker.3 took 8.937µs
INFO [runner] worker.7 took 4.844µs
INFO [runner] worker.8 took 3.712µs
INFO [runner] worker.6 took 4.49µs
INFO [runner] worker.4 took 15.735µs
INFO [runner] worker.5 took 7.698µs
INFO [runner] Workers idle times: #1: 73.105µs, #2: 83.24µs, #3: 60.622µs, #4: 15.325µs, #6: 33.897µs, #7: 54.757µs, #8: 44.14µs
INFO [runner] processing took 4.302µs with stages: max_same_issues: 907ns, skip_dirs: 409ns, path_prettifier: 378ns, nolint: 342ns, autogenerated_exclude: 335ns, cgo: 294ns, skip_files: 270ns, max_from_linter: 245ns, exclude: 238ns, path_shortener: 237ns, diff: 215ns, max_per_file_from_linter: 154ns, uniq_by_line: 147ns, source_code: 131ns
ERRO [runner] 0/22 linters finished: deadline exceeded
ERRO Deadline exceeded: try increase it by passing --deadline option
@jirfag
Copy link
Contributor

jirfag commented Nov 15, 2018

Hi!

  1. Can you disable linters one-by-one and find out which linters is working so slow? My guess is megacheck
  2. Can you wait (increase deadline) and find out how much time it gets to finish?

@gdankov
Copy link
Author

gdankov commented Nov 19, 2018

Hi @jirfag,

Thank you for the quick response!

  1. I tried disabling everything except govet and it still blocks, which leads me to believe the problem is somehow caused by the repo we are running it against. Also tried running golangci-lint against some of the repos that you listed in your Trusted By section and there was no problem in any of them. This is the repo I'm running it against.
  2. Increased deadline to 5 mins, same result.

@jirfag
Copy link
Contributor

jirfag commented Nov 23, 2018

I run it on MacOS too:

~/go/src/github.com/cloudfoundry-incubator/eirini (master)$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /Users/denis/go/src/github.com/cloudfoundry-incubator/eirini /Users/denis/go/src/github.com/cloudfoundry-incubator /Users/denis/go/src/github.com /Users/denis/go/src /Users/denis/go /Users/denis /Users /]
INFO [config_reader] Used config file .golangci.yml
INFO Gocritic enabled checks: [appendAssign assignOp caseOrder dupArg dupBranchBody dupCase flagDeref ifElseChain regexpMust singleCaseSwitch sloppyLen switchTrue typeSwitchVar underef unlambda unslice defaultCaseOrder]
INFO [lintersdb] Active 23 linters: [deadcode depguard dupl errcheck gocritic gocyclo gofmt goimports golint gosec govet ineffassign interfacer lll maligned megacheck misspell nakedret prealloc structcheck unconvert unparam varcheck]
INFO [loader] Go packages loading at mode load deps types and syntax took 8.466137508s
INFO [loader] SSA repr building timing: packages building 101.626566ms, total 5.706493727s
INFO [loader] SSA for megacheck repr building timing: packages building 318.82511ms, total 5.411312097s
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [] for 505ns
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [] for 354ns
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [] for 346ns
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [] for 350ns
INFO [runner] worker.3 took 6.097480809s with stages: interfacer: 2.666641497s, goimports: 2.303275849s, gocritic: 562.939558ms, gofmt: 318.59338ms, govet: 164.370349ms, unconvert: 63.242424ms, structcheck: 7.338348ms, maligned: 5.840407ms, nakedret: 5.148848ms, depguard: 7.88µs
INFO [runner] worker.2 took 6.125297929s with stages: golint: 4.808183188s, dupl: 748.347841ms, misspell: 286.429662ms, gosec: 125.130332ms, errcheck: 58.249185ms, ineffassign: 53.227368ms, varcheck: 18.939141ms, deadcode: 11.174277ms, lll: 8.603273ms, prealloc: 3.977265ms, gocyclo: 2.910459ms
INFO [runner] worker.4 took 7.148120896s with stages: unparam: 7.148076643s
INFO [runner] worker.1 took 12.636492079s with stages: megacheck: 12.636441947s
INFO [runner] Workers idle times: #2: 6.508766038s, #3: 6.513327491s, #4: 5.485995094s
INFO [runner] processing took 85.39831ms with stages: exclude: 56.522537ms, skip_dirs: 11.96454ms, cgo: 6.660235ms, nolint: 4.422587ms, autogenerated_exclude: 3.828752ms, path_prettifier: 1.981147ms, source_code: 2.848µs, diff: 2.647µs, uniq_by_line: 2.514µs, max_same_issues: 2.44µs, path_shortener: 2.124µs, max_per_file_from_linter: 2.087µs, skip_files: 1.958µs, max_from_linter: 1.894µs
INFO Memory: 199 samples, avg is 1956.1MB, max is 3712.4MB
INFO Execution took 33.285616414s

Also, there are no compilation errors, but they were in your log. I guess they could cause it. Can you reproduce it now? If yes, tell me repo's commit SHA on which it reproduces, please.

@gdankov
Copy link
Author

gdankov commented Dec 7, 2018

Also, there are no compilation errors, but they were in your log. I guess they could cause it. Can you reproduce it now?

There are no compilation errors any more and the issue is still present for me. Doesn't seem related.

If yes, tell me repo's commit SHA on which it reproduces, please.

I am running it against the current master, which has the following SHA: acafc8aaccee18023f9a5aa3e6b15171c84c7771

@gdankov
Copy link
Author

gdankov commented Dec 14, 2018

Upgrading go to 1.11.3 seems to fix the issue for me. My previous version was 1.10.3.

@jirfag, feel free to close the issue if you decide that you have no interest in supporting go 1.10.3.

@jirfag
Copy link
Contributor

jirfag commented Dec 22, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants