Opened 17 years ago
Closed 17 years ago
#4909 closed (fixed)
WSGIHandler is not threadsafe
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The call method of WSGIHandler is called from multiple threads, however there code that checks for the middleware being setup is not thread safe.
{{{if self._request_middleware is None:
self.load_middleware()}}}
Multiple threads can launch into load_middleware at once, leading to corrupt lists.
The attached patch uses a lock to protect the middleware loading if it's required.
Attachments (1)
Change History (3)
by , 17 years ago
Attachment: | wsgi-thread-safe-init.patch added |
---|
comment:1 by , 17 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Ready for checkin |
comment:2 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [5868]) Fixed #4909 -- Fixed a race condition with middleware initialisation in multi-threaded setups. Thanks, colin@….