Author zyasoft
Recipients darjus, jamesmudd, stefan.richthofer, zyasoft
Date 2017-04-04.23:24:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It is in fact a bug, a classic object publication/data race to be precise. The problem is that it is possible for a Java type to be published by one thread in classToType, as held by PyType#LazyClassToTypeHolder; but for another thread to simultaneously see/lookup this type for the first time.

We used to synchronize on this map, but that caused deadlocks (the original bug here). Then we introduced polling with the bug fix (, but we realized it was a hack, and linked it to this bug.

Probably the right way to fix this bug is to use a scheme actually seen in Lib/ - use associated condition variables to mark when the publication is finished. This should be close to the current code: continue polling on the existence of __getattribute__, but wait for the specific publication. So we can start with a ConcurrentMap<Class<?>, Condition>, publish it from one thread the specific condition variable using #putIfAbsent, and cv wait for it in
Date User Action Args
2017-04-04 23:24:51zyasoftsetmessageid: <>
2017-04-04 23:24:51zyasoftsetrecipients: + zyasoft, darjus, stefan.richthofer, jamesmudd
2017-04-04 23:24:51zyasoftlinkissue2487 messages
2017-04-04 23:24:50zyasoftcreate