[patch] Mutlithreading problem with QueryDict
|Reported by:||eugene@…||Owned by:||adrian|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
QueryDict and its base (MultiValueDict) modify their respective classes during copy(). It opens a hole for multithreaded servers resulting in random bugs. Following patch fixes it by replacing class manipulations with standard Python __copy__/__deepcopy__ methods.
Big thanks go to Alex Brown, who found the problem and load-tested the fix. It appears that #1442 and this patch solves all problems with multithreading revealed during load-testing.