Message5748
The current implementation of org.python.core.IdImpl is not fully thread save, because the #java_obj_id(Object) method is not synchronized. IdImpl uses a java.util.HashMap to store ID-values for objects. The API-doc for java.util.HashMap requires to synchronize concurrent access to HashMap.
IdImpl.java_obj_id(Object) method is indirectly called by thread.get_ident().
(thread.get_ident() -> org.python.core.Py.java_obj_id(Object) -> org.python.core.IdImpl.java_obj_id(Object)
Django uses thread.get_ident() in its transaction management code. I observed two deadlocks on a multiprocessor server, that were apparently caused by the IdImpl#isMap HashMap being corrupted. I can provide the Java thread dumps if anybody is interested.
The attached patch fixes this issue. |
|
Date |
User |
Action |
Args |
2010-04-26 09:58:42 | akruis | set | messageid: <1272275922.99.0.452670390139.issue1602@psf.upfronthosting.co.za> |
2010-04-26 09:58:42 | akruis | set | recipients:
+ akruis |
2010-04-26 09:58:42 | akruis | link | issue1602 messages |
2010-04-26 09:58:42 | akruis | create | |
|