Message12904
There is a race in org.python.core.PyJavaPackage.addClass(String, Class<?>) where the __dict__ may be updated by threads that are importing into two different PySystemState. The distinct import locks do not stop them running at the same time, but here they are updating (in my example) the PyJavaPackage representing javax.swing.text, in order to add an entry for Utilities that will map to the PyJavaType that represents it.
This does not seem very serious, since both threads (Thread-1 and Thread-3 in my example) are inserting the same object. Of course, it's still wrong.
In the case where each PySystemState has its own class loader and the class in question (a user-defined one, I suppose) enters through a distinct class loader in each thread, these are different classes and will have distinct PyJavaType objects. Unless the (Java) package managers also segregate their hierarchies by loader, there seems a risk here of mixing entries in sys.modules. I'll see if I can make that happen. |
|
Date |
User |
Action |
Args |
2019-12-26 16:54:31 | jeff.allen | set | messageid: <1577379271.78.0.988149626729.issue2834@roundup.psfhosted.org> |
2019-12-26 16:54:31 | jeff.allen | set | recipients:
+ jeff.allen, zyasoft, FraOrolo |
2019-12-26 16:54:31 | jeff.allen | link | issue2834 messages |
2019-12-26 16:54:31 | jeff.allen | create | |
|