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

Activating the pipenv sometimes hangs #25

Closed
brettatoms opened this issue Apr 28, 2018 · 9 comments · Fixed by #44
Closed

Activating the pipenv sometimes hangs #25

brettatoms opened this issue Apr 28, 2018 · 9 comments · Fixed by #44
Assignees
Labels
Milestone

Comments

@brettatoms
Copy link

Sometimes (pipenv-activate) hangs. It appears to happen in the (pipenv--force-wait (pipenv-venv)) call. The while loop in pipenv--force-wait spins forever when it happens but it doesn't always happen. At first it appears that emacs locks up but I can get back control with a C-g. I put a (message "waiting...") in that loop and that seemed to fix it or at least caused it to happen less often so it feels kind of like a race condition.

@pwalsh
Copy link
Owner

pwalsh commented Apr 29, 2018

Hi there @brettatoms

This commit was a fix for such. race condition cee6bc5

Can you please let me know which version of pipenv.el you are running?

@pwalsh pwalsh self-assigned this Apr 29, 2018
@pwalsh pwalsh added the bug label Apr 29, 2018
@pwalsh pwalsh added this to the Current milestone Apr 29, 2018
@brettatoms
Copy link
Author

I am running the latest in melpa which is commit 8298dae

@weepingcheese
Copy link

Hey @pwalsh, thanks for pipenv.el!

I have been experiencing the race condition/hang on activate as well, happening about 1/10 times. It looks like I'm on 8298dae as well (spacemacs develop branch). I was able to make it happen consistently by reducing the sit-for time in the pipenv--force-wait function from 0.1 to 0.01. Increasing to 1.0 or whatever (making it very large doesn't seem to have any adverse effect... the sit-for returns when the process finishes, maybe?) seemed to make the race condition less likely to occur.

But that was all on my work computer (maybe relevant that it is OSX, but not at all sure). Now I'm home I can't reproduce the hang.

@ghost
Copy link

ghost commented Oct 15, 2018

I encountered this bug as well

@pwalsh
Copy link
Owner

pwalsh commented Oct 15, 2018

hey @SirJls can you provide some details on when this occurs.

@brettatoms
Copy link
Author

@pwalsh This happens to me almost daily. It usually seems to happen when I switch between files in different projects with different pipenv environments so pipenv.el as activated when the projectile project changes. Usually I can hit Ctrl-G to cancel it and then call pipenv-activate directly and it works fine. But it doesn't happen every time so it seems like a race condition.

@pwalsh
Copy link
Owner

pwalsh commented Oct 15, 2018

@brettatoms cool. I've tried to reproduce with tests and in usage myself and have not. I will look at it when I can, but also happy for contributions.

@brettatoms
Copy link
Author

@pwalsh If I can come up with a reliable fix I'll definitely submit a PR. Also, I'm using Spacemacs development branch if that helps anyone else reproduce the problem.

brettatoms added a commit to brettatoms/pipenv.el that referenced this issue Oct 22, 2018
Sometimes the process status for (pipenv-venv) never leaves the "run" state and
therefore the loop in (pipenv--force-wait) spins forever and causes
the (pipenv-activate) to hang.  This commit replaces the wait loop with a process
sentinel that is called when (pipenv-venv) returns inside of (pipenv-activate)

Fixes pwalsh#25
brettatoms added a commit to brettatoms/pipenv.el that referenced this issue Oct 22, 2018
Sometimes the process status for (pipenv-venv) never leaves the "run" state and
therefore the loop in (pipenv--force-wait) spins forever and causes
the (pipenv-activate) to hang.  This commit replaces the wait loop with a process
sentinel that is called when (pipenv-venv) returns inside of (pipenv-activate)

Fixes pwalsh#25
brettatoms added a commit to brettatoms/pipenv.el that referenced this issue Oct 22, 2018
Sometimes the process status for (pipenv-venv) never leaves the "run" state and
therefore the loop in (pipenv--force-wait) spins forever and causes
the (pipenv-activate) to hang.  This commit replaces the wait loop with a process
sentinel that is called when (pipenv-venv) returns inside of (pipenv-activate)

Fixes pwalsh#25
@pwalsh
Copy link
Owner

pwalsh commented Dec 6, 2018

#45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants