question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Audit linter files if they spawn too many processes

See original GitHub issue

(Updated description after analysis)

Based on PR #12105, we should audit other linter files and make sure this pattern does not exist anywhere else i.e disallow spawning of too many processes for each file to be linted, because it’s a bad practice and unnecessarily increases the runtime of lint checks.

Method of Analysis: Not all linter files spawn processes in the above manner, so I started by searching for subprocess keyword in these files to look for this possibility.

  • If the keyword is found, I looked at how processes are being created.
  • If keyword not found, then I tried to understand on a high level how files are being lint without going into the “logic” part of the linter, and checked for similar behaviour - by looking into their perform_lint_checks or similar functions.

Linter files to be audited (with analysis/PR fixing them):

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DubeySandeepcommented, Apr 7, 2021

@sajalasati Thanks for sharing the method, it works for all the cases except the python_linter.py as we use linter modules to run pylint/isort checks, can you audit the python_linter file again and update the issue accordingly? 😃

0reactions
U8NWXDcommented, Aug 2, 2022

This appears to be done

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spawn of a lot python processes · Issue #3586 - GitHub
Expected behaviour​​ When a save is done, some linting process are created. After the save and the linting they should be gone.
Read more >
multiprocessing.Pool spawns too many threads - Stack Overflow
Therefore the assumption, that only as many hardware threads as the number of processes specified in the Pool constructor, is invalid. If ...
Read more >
Process Injection - Threat Detection Report - Red Canary
Process Injection enables adversaries to execute potentially suspicious processes in the context of seemingly benign ones.
Read more >
Does anyone know a simple way to monitor root process spawn
always Allocate an audit context, always fill it in at syscall entry time, and always write out a record at syscall exit time....
Read more >
Docker Machine Executor autoscale configuration - GitLab Docs
GitLab Runner can autoscale, so that your infrastructure contains only as many build instances as are necessary at any time. If you configure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found