-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Enabling pylint creates excessive amounts of python instances #4236
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
Comments
How large is your demo_multi_write.py file? |
@DonJayamanne Currently, it is 265 Lines. The largest file I'm working on currently is 1200 LoC |
Thanks for the info, helps us nail it. |
I have also encountered this just now in VSCode 1.36.1 and VSCode-Python 2019.6.24221. The pylint processes survive even when VSCode is fully terminated. Performing an strace on the orphaned processes, they are stuck on either read or accept syscalls against a unix socket fd in /tmp:
|
Please could you provide some sample code that would replicate this issue. Again please try linting the file from the terminal, and provide the results (does it complete or not) and provide the comments if this file do we can replicate it at our end. Here's the cli |
Sure, happy to try and help you reproduce it. I am working on https://github.com/certbot/certbot with a Python 3.7 virtual environment. The developer setup is documented here: https://certbot.eff.org/docs/contributing.html I don't have a smaller repro case at the moment. I noticed that it doesn't happen reliably - I think that there is either a timing or concurrency element to it. Most of the time the processes are cleaned up properly, but other times they will hang forever. The most reliable way I know to reproduce it quickly is to rapidly indent/outdent a random line and save the document after every change. After 5-10 seconds of doing that, a bunch of pylint processes will stack up and hang. Here are the stuck processes generated by VSCode:
If I run the command that you suggest, it is kind of slow but works okay and does not leave any processes behind:
(Click for full output)
If I run the command that is verbatim generated by VS Code, it also works fine:
There might be a concurrency issue in pylint itself (if concurrency is indeed the issue), but perhaps VSCode could kill try and serialize the use of pylint to avoid running into the stuck processes? |
Confirm issue. |
I discovered a way to reproduce this issue.
|
That's still an issue for 2019.11.50794 (22 November 2019) version. Run out of memory when Autosave option enabled. |
One possible solution to this is #3836 as we could probably implement that feature as a single execution after each edit, which would mean a single instance of any linter per edit. |
But the root issue here is that pylint instances are left open forever... |
A workaround using timeout:
Then make "pylintPath point at it:
|
Same problem. Running on a MacBook Pro. System started hanging. VS Code stopped responding. ps showed hundreds(?) of pylint instances. Examples:
Running manually:
This file has 629 lines. |
I tried reproducing similar behavior using pylint in the terminal(zsh) with for loops and even several terminals and I can not get one pylint stuck. The only place I can reproduce this is inside VS code when I make several small changes and save 5-10 times in a row. Thanks to @gatopeich workaround ( which works great :) Thanks). I am able to work without having to kill a bunch of processes every 1-2 hours so it would not OOM the machine. Adding some timeout or some other mechanism to cleanup these processes is needed. |
Hi all, please try out https://marketplace.visualstudio.com/items?itemName=ms-python.pylint extension which shouldn't have this issue. cc/ @karthiknadig |
Closing this s we have started the process of migrating users to the new pylint extension. |
Environment data
Expected behaviour
To only have one python process running pylint for each file open.
Actual behaviour
Hundreds of pylint processes open.

Steps to reproduce:
Not exactly sure, only noticed when computer started swapping to disk and check memory usage, but general steps to start having the processes spawn.
More python processes running pylint will open as time goes on and files get closed/opened. The processes don't end when the file is closed.
The text was updated successfully, but these errors were encountered: