-
-
Notifications
You must be signed in to change notification settings - Fork 934
Sporadic failures in Popen()
under Windows with processes left in subprocess._active
list
#508
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
The following TC reproduces stochastically the failure:
When I run it, on my PC it fails the 3rd time:
|
I managed to workaround it by adding
But is this expected? |
Thanks for describing the issue in such great detail, and actually digging down to the root cause of it ! What we might see here is GitPython's failure to cleanup its system resources correctly, as it was made in a time when destructors actually ran deterministically even in python. GitPython itself seems to expect this, even though that never runs in newer python interpreters as the GC runs too rarely. The side-effect of the resource leakage appears to be the issue you have noticed. It's a general problem, and the only workaround I see is to make these calls manually. The problem is that everything allocating resources should in fact be used in a context to assure proper cleanup, which would require something like @ankostis What do you think can be sensibly be done here ? |
Thank you for your frank clarification of the problem. In cases like that, where I now the problem but it's huge and I don't have the resources, I enter damage control mode: adding "Known Limitations" sections in the manual, or marking every possible resource method as problematic in the docs. In the good case, people start to get annoyed and search for workarounds. |
Great idea ! I have just added a new |
I have identified another "deterministic" failure, with the index code relying on destructor in py3.5. The following code reproduces it:
The problem originates at
But a more proper solution would be to retrifit |
I note that the previous "index" issue is a show-stopper, and impossible to workaround even when applying the advice you wrote in the manual, because the So either you a) modify the project sources, or b) try-catch and explicitly invoke GC then, which is pretty ugly. I would really suggest By the way, I believe that the duplicated |
@Byron I can open it as a new issue if you think it is worth it. |
Thanks for your investigation , I would love to have an issue for this and
|
Under Windows, when running test-cases creating different temporary repositories consecutively, I get sporadic failures when executing the
git
process:Popen()
, thesubprocess._active
list contains 2 leftovers processes, while this list is always empty when not failing.time.sleep()
but it did not help.v2.0.8
and latest master from github(df65f51) (2.0.9-dev0
).0.9.0
0.6.4
An minor note: the try-catch
Popen()
code assumes that any exception caught is becausegit
was not found, while above it obviously not the case.The text was updated successfully, but these errors were encountered: