-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
WIP/CI: Debug ResourceWarnings unclosed io.BufferedRandom #44634
Conversation
Note using psutil in
Doesn't seem to uncover files: https://github.com/pandas-dev/pandas/runs/4348313550?check_suite_focus=true
|
i guess BufferedRandom isn't a "real" file object? (which would also explain why td.check_file_leaks isn't catching it). the docs mention that BufferedRandom is threadsafe, so maybe the flakiness involves gc timing? |
could try passing |
Looks like https://docs.python.org/3/library/subprocess.html#popen-constructor |
Looking at cpython source, one hint is that this object was opened in Not pointing fingers necessarily, but |
@pganssle we're trying to track down ResourceWarnings caused by unclosed io.BufferedRandom objects. AFAICT these are not being seen by psutil.open_files. Looking for a way to check "give me a list of all unclosed BufferedRandom objects". Suggestions on either how to do this or where to open an issue about how to do this? |
CI seems to fail randomly about 50% of the time, sometimes with this error. My last PR push failed in test_xlswriter.py (See log). I just re-triggered CI to get my green tick! io.BufferedRandom unclosed file log: unclosed file.log |
Another suspect from ipython, a file opened in
https://github.com/ipython/ipython/blob/ef1d8add5d975b88bfcbccb6fecf146b29a15154/IPython/core/history.py |
Looks like you had addressed leaking iPython files in the past @jbrockmendel: #35836 |
Assuming #44700 addressed the |
e.g.
https://github.com/pandas-dev/pandas/runs/4337388614?check_suite_focus=true
https://github.com/pandas-dev/pandas/runs/4337843423?check_suite_focus=true