||FraOrolo, jeff.allen, zyasoft
|Marked as misclassified
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.
Confirmation would be appreciated that I'm reproducing the circumstances of this issue. Or a script that reproduces the actual issue.
|2019-12-27 23:32:58||jeff.allen||set||messageid: <firstname.lastname@example.org>|
+ jeff.allen, zyasoft, FraOrolo|
|2019-12-27 23:32:58||jeff.allen||link||issue2834 messages|