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

Caching of the linting data causing timeout. #730

Closed
3 tasks done
subhroacharjee opened this issue Apr 20, 2023 · 1 comment
Closed
3 tasks done

Caching of the linting data causing timeout. #730

subhroacharjee opened this issue Apr 20, 2023 · 1 comment
Labels
area: cache question Further information is requested

Comments

@subhroacharjee
Copy link

subhroacharjee commented Apr 20, 2023

Welcome

  • Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Description of the problem

The issue at hand is related to the linting process, when the lint job is executed more than once with netrox/act on a local machine or in a GitHub Action, it gets timeout and even with timeout it takes a lot of time. Two example of run are as follows

first run
first run
second run
second run

As per my understanding this problem arises when the golangci-lint tool, caches its data during the first run and reuses it on the second run. This causes the available memory to be reduced to less than 100mb, leading to a timeout error during the linting process. The error message indicates that there's not enough memory available to complete the process.
This problem has been identified by examining the logs from the production environment.

production log from GH actions
image

One workaround to solve this issue is to add a timeout to the linting process, but this can significantly increase the time it takes to complete the job. This is not an ideal solution, as it can slow down the development process and cause delays. Given this delay is much higher than the cli tool, it's becomes really slower in comparison.

same command in local cli
image

Version of golangci-lint

latest - 1.52.2

Version of the GitHub Action

3

Workflow file

setup-go uses actions/setup-go@v3 along with few other configuration to include the private vendors, install go dependencies and caching those dependecies.
jobs:
  lint:
    name: Golang Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: ./.github/actions/setup-go
        with:
          go-version: 1.18
          personal-access-token: ${{ secrets.REPO_ACCESS_TOKEN }}
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v3
        with:
          version: latest
          skip-pkg-cache: true
          only-new-issues: true

Go version

1.18

Code example or link to a public repository

Private repo code cant be shared.

// add your code here
fho added a commit to simplesurance/baur that referenced this issue May 17, 2023
Enabled cache causes golangci-lint to timeout.
This might be the issue described in:
golangci/golangci-lint-action#730
@ldez ldez added the question Further information is requested label Jun 10, 2023
@ldez
Copy link
Member

ldez commented May 4, 2024

Hello,

The caching process has been improved.
The action was caching too many things.

@ldez ldez closed this as completed May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cache question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants