-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
Jedi creating too many processes when VIRTUAL_ENV not set? #1242
Comments
I'm trying to solve it in #1238. |
got the same issue after appending |
immerrr
added a commit
to immerrr/emacs-jedi
that referenced
this issue
Dec 6, 2018
The problem is that when environment is not specified explicitly for Script object it is populated automatically via "get_cached_default_environment", but the cache doesn't work and thus new subprocesses were created for each request (and cleaned up by GC at some point in the future). davidhalter/jedi#1242
This was referenced Dec 6, 2018
Closed
This was referenced Dec 10, 2018
I only just realized how bad this issue was. Big sorry for that. I therefore did a release immediately. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like there have been a few reports of "too many open files" since recent commit 862f611, most of which are in other projects I think. Examples:
On my macOS system, using anaconda-mode from Emacs, I think there may be a problem when the
VIRTUAL_ENV
environment variable is not set. I thinkEnvironment.path
gets set fromsys.prefix
? In the case whereVIRTUAL_ENV
is not set,environment.path != os.environ.get('VIRTUAL_ENV')
inget_cached_default_environment
will always be false I think, which seems like it will clear the cached environment and start a new environment over and over?Should the new check added in 862f611 avoid calling
clear_cache
ifVIRUTAL_ENV
is None?(Of course, that doesn't help if someone changes it from an actual virtualenv path to
None
. Maybe an environment'sVIRTUAL_ENV
environment variable at creation time should be stashed away somewhere, and you just check that directly?)On my system I think I have seen this manifested by having ~76 instances of the following subprocesses under the top-level Jedi process started by anaconda-mode:
anaconda-mode does happen to be starting a Python interpreter inside a virtual environment by virtue of my
PATH
, but based on my analysis above, I don't think that's relevant.Sorry if this is not a bug, or just an artifact of other projects misusing Jedi. I'm afraid I only use Jedi indirectly from things like anaconda-mode or python-language-server so this is a hasty and probably incomplete diagnosis. I wanted to open an issue to get an expert opinion.
Indirectly or not, though, I've used Jedi for years and it's been a godsend! Thanks for your work!
The text was updated successfully, but these errors were encountered: