Message12910
Actually, I wrote too soon.
If I let Thread-2 overtake Thread-1, after finding Thread-1's definition, it makes it into org.python.core.imp.ensureFromList(). Here it starts looking for a package called thin.air.Foo.*, and does consult the specific class loader, although with a variety of spurious names (like "Foo.class.__doc__"). (See also #2854.)
The root of the problem I've found is that distinct sys modules continue to share a common package manager, which is a static member of PySystemState. The solution, I think, is to ensure each sys has its own package manager, and that they are synchronised properly (to cover the case where multiple threads access one PySystemState).
Meanwhile, every import works just fine: no missing attributes or reported exceptions. So I'm not at all sure I'm studying the problem Martin Ginkel observed. The original post is a pretty fair description of how 2.7.1 behaved and 2.7.2 doesn't.
I have pushed the change which adds my JUnit test. In the interests of a clean build, the failing assertions are commented out.
https://hg.python.org/jython/rev/e306270a4771
Confirmation would be appreciated that I'm reproducing the circumstances of this issue. Or a script that reproduces the actual issue. |
|
Date |
User |
Action |
Args |
2019-12-27 23:32:58 | jeff.allen | set | messageid: <1577489578.88.0.885602782636.issue2834@roundup.psfhosted.org> |
2019-12-27 23:32:58 | jeff.allen | set | recipients:
+ jeff.allen, zyasoft, FraOrolo |
2019-12-27 23:32:58 | jeff.allen | link | issue2834 messages |
2019-12-27 23:32:58 | jeff.allen | create | |
|