-
Notifications
You must be signed in to change notification settings - Fork 11
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
Something is opening file descriptors and not closing them #51
Comments
I've had some idea of re-implementing the parallel mode with threads, because the multiprocessing strategy doesn't work with python-3.8 (can't seem to pass references to functions decorated with Separately, there is the idea of replacing unfortunately I've been neglecting these two projects recently, with the usual excuse, busy at work on other stuff ... |
I did think about poll as well. Maybe I'll give something a shot if you'll accept a PR. |
Well, something as simple as this works in io.py:
File descriptors for the parent fab process still go over 1024 but fabric no longer bails. Not sure if something more robust than that is needed. Looks context_managers.py uses select as well and could probably use the same treatment. |
Yup, feel free to open a PR. But notice that the paramiko PR checks whether |
Using select() here causes a file descriptor leak. We've replaced this with a poll() implemenetation to avoid this. The polling object needs to be opened with an eventmask that stops it from blocking paramiko. Fixes ploxiln#51 Co-authored-by: Dan Porter <[email protected]>
Using select() here causes a file descriptor leak. We've replaced this with a poll() implementation to avoid this. The polling object needs to be opened with an eventmask that stops it from blocking paramiko. Fixes ploxiln#51 Co-authored-by: Dan Porter <[email protected]>
Using select() here causes a file descriptor leak. We've replaced this with a poll() implementation to avoid this. The polling object needs to be opened with an eventmask that stops it from blocking paramiko. Fixes ploxiln#51 Co-authored-by: Dan Porter <[email protected]>
Easy to reproduce. Just run a fabric task across 1024+ hosts on. The per process file descriptor will trigger and the first place fab-classic breaks is on this select:
As far as where this is happening, the best read I have on it seems like sys.stdout and/or other sys based output streams are being duplicated through the threadable call to io.py and output/input_looper functions.
I can say that this doesn't happen at all in the original fabric package. It also doesn't seem to happen under fab-classic using python2.7 - I've tested 3.6.9 and 3.7.5 and they both have this problem.
Doing something like this at the bottom of the tasks.execeute():
While silly, this stops the leak. It breaks all the other output of the program. There is a noted difference between fd.close() and os.close(fd).
The best I can tell is it seems like fd.close() leaves the C level file descriptor open in python 3.x but I'm not sure why yet.
The text was updated successfully, but these errors were encountered: