Message12626

Author amoebam
Recipients amoebam, jeff.allen, tcdelaney
Date 2019-08-08.20:20:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565295606.56.0.0834229610305.issue2642@roundup.psfhosted.org>
In-reply-to
Content
Just dropping in to report that contrary to Jeff's hope, #2609 did not fix this.

I've checked with a 2.7.2a1+ built from hg master at the time of posting, and it is still necessary to prevent Python imports from coinciding on different JVM threads -- otherwise we observe "impossible" errors such as the Python code "from collections import deque" failing with an ImportError "cannot import name deque".

The underlying cause is, as you might guess, that the first thread to request an import starts initializing the new object, but the second thread receives a reference to the same object while the first thread is still only halfway through the classDictInit method, requests an attribute that has not been added yet, and dies.

So, a global lock it is, for now.  But we're not quite confident we're locking the right things - we've stopped seeing crashes, but maybe we've just made them much rarer? - and it would be much better if whatever locking is actually required were done by Jython itself.
History
Date User Action Args
2019-08-08 20:20:06amoebamsetmessageid: <1565295606.56.0.0834229610305.issue2642@roundup.psfhosted.org>
2019-08-08 20:20:06amoebamsetrecipients: + amoebam, jeff.allen, tcdelaney
2019-08-08 20:20:06amoebamlinkissue2642 messages
2019-08-08 20:20:06amoebamcreate