#7676 closed (fixed)
django serializers are not thread safe!
Reported by: | sector119 | Owned by: | nobody |
---|---|---|---|
Component: | Core (Serialization) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
HI All!
I have to deserialize, serialize objects in multiple threads with django serializers.
But when I run Deserializer = serializers.get_deserializer(SERIALIZATION_FORMAT) in my threads (more then one, with _one_ thread all works great) I get KeyError? in get_serializer function at return _serializers[format].Deserializer line because _load_serializers does not load all data at _serializers dict before another tread run get_deserializer at this another thread and completely populate serializers dictionary with all, builtin and user-defined serializers! That is why I think that get_(de)?serializers and/or _load_serializers must be thread safe like _populate function at AppCache?!
Attachments (2)
Change History (10)
by , 16 years ago
Attachment: | threadsafe_serializers.diff added |
---|
comment:5 by , 16 years ago
Component: | Uncategorized → Serialization |
---|---|
milestone: | → 1.0 |
As this is a bug, I'd assume it's in scope for 1.0.
by , 16 years ago
Attachment: | threadsafe_serializers-same_public_api.diff added |
---|
Don't break the public API and be explicit about what is and is not thread-safe.
comment:7 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Threadsafe initialization of the _serializers dict