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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak if run lefthook run inside command #425

Closed
strpc opened this issue Feb 10, 2023 · 2 comments 路 Fixed by #426
Closed

Memory leak if run lefthook run inside command #425

strpc opened this issue Feb 10, 2023 · 2 comments 路 Fixed by #426
Labels
bug Something isn't working

Comments

@strpc
Copy link
Contributor

strpc commented Feb 10, 2023

馃敡 Summary

Hi! I'm see a memory leak if run lefthook run inside lefthook command.

Lefthook version

1.2.7, 1.2.8

Steps to reproduce

Example config:

pre-commit:
  commands:
    format:
      run: lefthook run format

format:
  piped: true
  parallel: false
  commands:
    # number prefix used to save ordering
    1_autoflake:
      glob: "*.py"
      run: autoflake --recursive --ignore-init-module-imports --remove-all-unused-imports --remove-unused-variables --in-place {staged_files}
    2_isort:
      glob: "*.py"
      run: isort --color --quiet {staged_files}
    3_black:
      glob: "*.py"
      run: black {staged_files}
    4_pyup_dirs:
      glob: "*.py"
      run: pyup_dirs --py311-plus {staged_files} | true
    4_black_check:
      glob: "*.py"
      run: black --check {staged_files}

Expected results

Low memory usage

Actual results

High memory usage

Possible Solution

Screenshots (if appropriate)

1.2.6:
Screenshot 2023-02-10 at 18 49 10

1.2.7:
image

1.2.8:
image

@strpc strpc added the bug Something isn't working label Feb 10, 2023
@mrexox
Copy link
Member

mrexox commented Feb 10, 2023

Wow! Thank your for the issue! I will take a look at this bug. This is unbelievable 馃槺

@strpc strpc mentioned this issue Feb 10, 2023
2 tasks
@strpc
Copy link
Contributor Author

strpc commented Feb 10, 2023

I found out: bug in deps https://github.com/briandowns/spinner
I have updated this to v1.21.0 https://github.com/briandowns/spinner/releases/tag/v1.21.0 and memory got better

PR open

mrexox pushed a commit that referenced this issue Feb 13, 2023
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

Successfully merging a pull request may close this issue.

2 participants