Message309402
I'm working on a project where I need to share state between several processes (forked using gunicorn). I'm using dictionaries obtained from a multiprocessing SyncManager to achieve this.
The issue is that if I have multiple forked processes concurrently accessing to different dictionaries created by the same SyncManager, the code will randomly crash while accessing (read-only and read-write) to any of the dictionaries. This behaviour is independent of the way I access the dictionary (i.e. it happens both using the dictionary functions (e.g. has_key) or the built-in keywords (e.g. key in dict).
The attached snippet demonstrates the issue (tested only in python2.7): the function test_manyForkedProcessesSingleThreaded will crash.
The issue is also being discussed here: https://stackoverflow.com/questions/48052148/python-multiprocessing-dict-sharing-between-processes |
|
Date |
User |
Action |
Args |
2018-01-03 09:44:21 | André Neto | set | recipients:
+ André Neto |
2018-01-03 09:44:21 | André Neto | set | messageid: <1514972661.4.0.467229070634.issue32485@psf.upfronthosting.co.za> |
2018-01-03 09:44:21 | André Neto | link | issue32485 messages |
2018-01-03 09:44:20 | André Neto | create | |
|