Skip to content

"Failed to get persisted facts" errors with --allow-parallel-runners option #1769

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

Open
autarch opened this issue Feb 22, 2021 · 2 comments
Open
Labels
bug Something isn't working

Comments

@autarch
Copy link

autarch commented Feb 22, 2021

Thank you for creating the issue!

  • [ X ] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • [ X ] Yes, I've searched similar issues on GitHub and didn't find any.
  • [ X ] Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.37.1 built from b39dbcd6 on 2021-02-20T11:48:06Z
Config file
$ cat .golangci.yml
run:
  timeout: 5m
  skip-dirs:
    - service/.*/db$
    - service/.*/dbmodels$
    - service/.*/k8s$
    - service/.*/models$
    - service/.*/restapi$

linters:
  disable-all: true
  enable:
    - bodyclose
    - deadcode
    - errcheck
    - gocritic
    # We need to include both gofmt and goimports so we can get the simplify
    # suggestions from gofmt. See https://github.com/golang/go/issues/21476
    # for more info.
    - gofmt
    - goimports
    - golint
    - gosimple
    - govet
    - ineffassign
    - maligned
    - misspell
    - staticcheck
    - structcheck
    - typecheck
    - varcheck
    - whitespace
  fast: false

linters-settings:
  govet:
    check-shadowing: true
  errcheck:
    check-type-assertions: true

issues:
  max-issues-per-linter: 0
  max-same-issues: 0
  exclude-rules:
    - path: service/scheduler/web/handlers\.go
      linters:
        - ineffassign
Go environment
$ go version && go env
go version go1.15.8 linux/amd64
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/autarch/.cache/go-build"
GOENV="/home/autarch/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/autarch/go/pkg/mod"
GONOPROXY="github.com/ActiveState"
GONOSUMDB="github.com/ActiveState"
GOOS="linux"
GOPATH="/home/autarch/go"
GOPRIVATE="github.com/ActiveState"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/autarch/go/src/github.com/ActiveState/TheHomeRepot/go.mod"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build102268167=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here

Running that command won't really demonstrate anything, since the problem is with parallel runs.

The issue we've found is that running golangci-lint in parallel across many Go packages at once randomly raises cache errors.

Here's an example command that is being run:
golangci-lint run --config ./golangci-lint.yaml --new-from-rev HEAD~1 --allow-parallel-runners service/some-service/status/testcommon

And we get the following output:

[linters context/goanalysis] Failed to get persisted facts: failed to get data from low-level cache by key fact_deprecated/facts for package poly1305: read 0/175 bytes from /home/circleci/.cache/golangci-lint/6d/6d78660c561490491927308565fcbb57fcd62192de30916210f7d6d106df67d7-a with error EOF

Typically this will happen a few times (2-4) when running this across dozens of directories. The directories where this happens vary each time. Running with --allow-serial-runners seems to make this go away.

I'm guessing there's some sort of race condition with parallel runners and the cache files/directories.

@autarch autarch added the bug Something isn't working label Feb 22, 2021
@autarch
Copy link
Author

autarch commented Feb 22, 2021

Note that a similar issue was reported in #925. I don't know if this new problem is related.

@stale
Copy link

stale bot commented Mar 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No recent correspondence or work activity label Mar 30, 2022
@ldez ldez removed the stale No recent correspondence or work activity label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants