| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
!buildbot .*Windows11.*Refleaks |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @brettcannon for commit 50e4c5d 🤖 The command will test the builders whose names match following regular expression: .*Windows11.*Refleaks The builders matched are:
|
Sorry, something went wrong.
|
This is probably what we should have done. |
Sorry, something went wrong.
|
FYI the Windows 11 refleak builder has not come back yet, so the green CI is a little misleading until we can get confirmation this PR doesn't leak under Windows. |
Sorry, something went wrong.
There was a problem hiding this comment.
I'm now curious if it does fix the issue.
Sorry, something went wrong.
|
I'm still able to reproduce the leak in the main branch: vstinner@WIN C:\victor\python\main>python -m test test_import -m test_concurrency -R 3:3 test_import leaked [38, 36, 40] references, sum=114 test_import leaked [38, 36, 40] memory blocks, sum=114 And with this PR: this is no leak, it works! vstinner@WIN C:\victor\python\main>python -m test test_import -m test_concurrency -R 3:3 Running Debug|x64 interpreter... 0:00:00 Run tests sequentially 0:00:00 [1/1] test_import beginning 6 repetitions 123456 ...... == Tests result: SUCCESS == 1 test OK. Total duration: 7.7 sec Tests result: SUCCESS Well done @brettcannon and @Eclips4! |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM since it does fix the leak :-) I left a review, feel free to address it, or ignore my remarks ;-) Thanks for fixing Windows Refleaks buildbots!
Sorry, something went wrong.
There was a problem hiding this comment.
+1 to all of Victor's words.
LGTM!
(I've check it on my windows setup and this solution seems fine, refleaks are gone)
Sorry, something went wrong.
|
I would prefer to backport it to 3.12, because:
|
Sorry, something went wrong.
|
This also solves the #104702. |
Sorry, something went wrong.
|
Thanks for the reviews and verification! I should be able to get this merged at worst by Friday, but hopefully sooner. |
Sorry, something went wrong.
|
I addressed the review comments from Victor, updated against main, flagged this for 3.12, and now I'm waiting for CI to go green again before I merge. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. Thanks for the update!
Sorry, something went wrong.
|
Thanks @brettcannon for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
|
GH-108612 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
…cross multiple threads (pythonGH-108497) (cherry picked from commit 5f85b44) Co-authored-by: Brett Cannon <brett@python.org>
Thanks. I took the freedom of merging your PR. It became difficult to read buildbot results these days, since there are more and more known failures. This fix should reduce the number of failed buildbots! |
Sorry, something went wrong.
|
Again, thanks for the fix @brettcannon and @Eclips4! |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot aarch64 Fedora Stable LTO 3.x has failed when building commit 5f85b44. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/336/builds/3857 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 448 tests OK. 10 slowest tests:
1 test failed: 14 tests skipped: 1 re-run test: Total duration: 4 min 44 sec Click to see traceback logsTraceback (most recent call last):
File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/test/test_concurrent_futures/test_shutdown.py", line 49, in test_interpreter_shutdown
self.assertFalse(err)
AssertionError: b'Exception in thread Thread-1:\nTraceback (most recent call last):\n File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/threading.py", line 1059, in _bootstrap_inner\n self.run()\n File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/concurrent/futures/process.py", line 339, in run\n self.add_call_item_to_queue()\n File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/concurrent/futures/process.py", line 394, in add_call_item_to_queue\n self.call_queue.put(_CallItem(work_id,\n File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/multiprocessing/queues.py", line 94, in put\n self._start_thread()\n File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/multiprocessing/queues.py", line 177, in _start_thread\n self._thread.start()\n File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/threading.py", line 978, in start\n _start_new_thread(self._bootstrap, ())\nRuntimeError: can\'t create new thread at interpreter shutdown\nTraceback (most recent call last):\n File "<string>", line 1, in <module>\n File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/multiprocessing/spawn.py", line 122, in spawn_main\n exitcode = _main(fd, parent_sentinel)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/multiprocessing/spawn.py", line 132, in _main\n self = reduction.pickle.load(from_parent)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-aarch64.lto/build/Lib/multiprocessing/synchronize.py", line 115, in __setstate__\n self._semlock = _multiprocessing.SemLock._rebuild(*state)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory\n' is not false
|
Sorry, something went wrong.
| # Dictionary protected by the global import lock | ||
| # For a list that can have a weakref to it. | ||
| class _List(list): | ||
| pass |
There was a problem hiding this comment.
FWIW, I think it would be nice to use __slots__ for this class, to reduce the size of each instance (especially since the setdefault call creates one each time, even when it isn't necessary).
Sorry, something went wrong.
There was a problem hiding this comment.
As in you're going to make a PR to make that change, or you're hoping someone else will open an issue on your behalf to track the idea?
Sorry, something went wrong.
There was a problem hiding this comment.
The latter (although not on my behalf) -- I don't know if there's a reason not to do it, and I don't have the spare cycles to dig in and find out.
Sorry, something went wrong.
|
FWIW, this does not seem to have resolved the refleak in test_import in 3.12 (see e.g. https://buildbot.python.org/all/#/builders/1125/builds/115) even though it does seem to have fixed them in main. Does anyone want to take a look at why test_import is still leaking in 3.12? |
Sorry, something went wrong.
|
Nevermind, the leak was from a different issue (still not resolved on main, but more cleverly hidden). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
When importing, import deadlock detection tracks which threads are importing which modules in a list. Prior to this change, a list was created per thread but never disposed of. Now, the list is disposed of properly using weakrefs to guarantee GC doesn't interrupt the cleanup.
Co-Authored-By: Kirill Podoprigora kirill.bast9@mail.ru