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
weakref spewing exceptions during finalization when combined with multiprocessing #73705
Comments
Antoine, bpo-28427 introduces a regression. When used with multiprocessing, the WeakValueDictionary in In effect, I'm getting spew like this: Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7fb2b905e2f0>
Traceback (most recent call last):
File "/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/python3.6/weakref.py", line 112, in remove
TypeError: 'NoneType' object is not callable
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7fb2b905e2f0>
Traceback (most recent call last):
File "/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/python3.6/weakref.py", line 112, in remove
TypeError: 'NoneType' object is not callable
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7fb2b905e2f0>
Traceback (most recent call last):
File "/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/python3.6/weakref.py", line 112, in remove
TypeError: 'NoneType' object is not callable
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7fb2b905e2f0>
Traceback (most recent call last):
File "/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/python3.6/weakref.py", line 112, in remove
TypeError: 'NoneType' object is not callable When debugged, this 'NoneType' is I'm working on a smaller repro, unfortunately this happens as part of a rather large multiprocessing app so this might take a while. Just wanted to let you know, maybe you'll know right away what the problem is. |
I have a pretty minimal repro. You'll have to download both Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7fcb56b09400>
Traceback (most recent call last):
File "/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/python3.6/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable I can reproduce this both on CentOS 7 and macOS Sierra. I don't quite understand what makes this particular combination of instructions in the modules trigger the problem, I'd appreciate some explanation. AFAICT any additional simplification to the two modules makes it stop producing the spew. Note: the spew doesn't happen with 3.6.0, only with master because it's directly caused by the missing global after the change in bpo-28427. |
New changeset 2cb530243943 by Łukasz Langa in branch '3.5': New changeset c5267272e66a by Łukasz Langa in branch '3.6': New changeset e91ec62da088 by Łukasz Langa in branch 'default': |
Given that the weakref behavior during shutdown with the repro was identical in 3.6.0, as well as in 3.5.2 and earlier, I patched this by binding the name to a local, therefore making it usable also during finalization. |
New changeset 6c961c5a5396ef125dbbc47c060272a5d12c1646 by Łukasz Langa in branch 'master': New changeset 39279a07e8fc7bc14dcb948d970c12dbbf65ff40 by Łukasz Langa in branch 'master': New changeset 8d6fcedf53048ff53cde91f7a55c1583456fa15e by Łukasz Langa in branch 'master': |
gsutil shows massive "Exception ... ignored" message from this regression. I think we should backport this fix to Python 2.7.14. |
Will this be released in 2.x as suggested by inada.naoki? |
It seems it is merged in 2.7.14. https://raw.githubusercontent.com/python/cpython/c707893f9cee870bba8364b3a06eb9cfa3b80e58/Misc/NEWS |
Ditto. On Sun, 03 Dec 2017 at 16:53, INADA Naoki <report@bugs.python.org> wrote:
-- |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: