#14533 closed (fixed)
django signals not thread-safe
| Reported by: | milosu | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Other) | Version: | 1.2 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
django dispatcher.Signal methods connect and disconnect are not thread-safe, observed while using johnny cache
patch and test case attached
Attachments (2)
Change History (9)
by , 15 years ago
| Attachment: | signals_ts.patch added |
|---|
by , 15 years ago
| Attachment: | signal_ts.py added |
|---|
comment:1 by , 15 years ago
comment:2 by , 15 years ago
| Has patch: | set |
|---|
comment:6 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
attached test case should crash some threads with the following exception:
Exception in thread Thread-99: Traceback (most recent call last): File "c:\Python26\lib\threading.py", line 532, in __bootstrap_inner self.run() File "signal_ts.py", line 25, in run signals.post_delete.disconnect(self.handler2, sender=None) File "c:\Python26\lib\site-packages\django_versions\trunk\django\dispatch\dispatcher.py", line 141, in disconnect del self.receivers[index] IndexError: list assignment index out of rangeattached patch solves this problem for me and passes django test suite