Ticket #5567 defect new
failure.Failure() isn't 100% thread-safe
| Reported by: | teratorn | Owned by: | |
|---|---|---|---|
| Priority: | lowest | Milestone: | |
| Component: | core | Keywords: | threads |
| Cc: | Branch: | ||
| Author: | Launchpad Bug: |
Description
It's often necessary to instantiate Failure objects from non-reactor threads to e.g. fail a Deferred which was passed in to the thread-using code to report its success or failure:
try:
...
except:
reactor.callFromThread(d.errback, failure.Failure())
Thus, instantiating Failure really ought to be fully thread-safe. The current implementation increments a global 'count' variable non-atomically, for one thing. I've not audited the rest of the code to determine its apparent thread-safety, but someone should before closing this ticket.
The 'count' variable isn't super-critical as it's just used for logging statements. Other problems may exist which are critical.
Change History
Note: See
TracTickets for help on using
tickets.
