[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think the solution can be simpler. PR 3033 uses the global import lock for guarding modification of the _module_locks dictionary. -- components: +Interpreter Core -Tests stage: -> patch review type: -> behavior versions: +Python 3.6 _

[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +3068 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread STINNER Victor
STINNER Victor added the comment: I wrote https://github.com/python/cpython/pull/3029 which seems to fix the issue. I don't know importlib well enough to understand why we need a weak reference to a lock. My PR adds a second lock per module lock (!) to be able to wait until _module_locks[nam

[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3064 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread STINNER Victor
STINNER Victor added the comment: The problem is the weakref callback of _module_locks. It seems like the callback is called after a second thread replaced _module_locks[name] * Thread 1: _get_module_lock('random') sets _module_locks['random'] and registers a weakref callback on the newly crea

[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread STINNER Victor
STINNER Victor added the comment: Oh, it's easy to reproduce the bug on the master branch. Example on Linux: haypo@selma$ ./python -m test test_threaded_import Run tests sequentially 0:00:00 load avg: 0.16 [1/1] test_threaded_import Exception ignored in: .cb at 0x7f53201e2f70> Traceback (most re

[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-07-28 Thread STINNER Victor
New submission from STINNER Victor: See bpo-bpo-30891 and bpo-30876 for recent changes in importlib. http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.x/builds/57/steps/test/logs/stdio 1:33:30 [312/406/2] test_threaded_import passed (30 sec) -- running: test_decimal (82