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
Run leakchecks on Python 3.7 #1197
Comments
And the results of 'make leaktest':
It's nice to see 5 tests that "leaked" on Python 2 don't on Python 3.7. Of the failures, lots of the leaked refs are 'internal' python details: cell, method, function, getset_descriptor, builtin_function_or_method. Perhaps some of those need to be added to the excluded types in leakcheck.py, but it will take some study. Lots of them are various exception classes (chaining?). Representative from test_socket_dns:
But there are clearly some substantial differences, especially when it comes to sockets or pywsgi. Representative pywsgi:
|
Yup, the bulk of the exception problems were chaining. We were raising a static exception object, and as the leaktests repeat over and over, the refs build up. I've also dropped the bulk of our own refcounting code in favor of objgraph. The idea is that it will make debugging leaks easier (though so far I haven't really had to use that). Switching to objgraph (and avoiding too many closures) also helped. |
Fixes #1197 Switch to objgraph to handle the measurement for us. That cleared up a few of the obscure issues with references to functions/getset_descriptors and the like. (Possibly because it keys by string names and we were keeping type objects alive.) Many of the real failures were due to re-using exception instances, which is bad because of chaining. Most of the @ignore_leakcheck are for performance, only one is for a real issue---and that test was skipped already on CI anyway for being too flaky.
Description:
We currently run these on CPython 2.7. The first time I tried to run them on Python 3 it was a mess. 3.7's cleanup of the way frame objects handle references should hopefully simplify things.
With luck we'll only need to tweak the rules in src/greentest/greentest/leakcheck.py to get a clean run.
The text was updated successfully, but these errors were encountered: