AttributeError: _factory - lazy imports are not threadsafe
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Unassigned | ||
loggerhead |
Triaged
|
Critical
|
Unassigned | ||
loggerhead-breezy |
Triaged
|
High
|
Unassigned |
Bug Description
I can reasonably reliably reproduce this with loggerhead by firing it up and hitting it with ab -c, and it's not hard to see what happens in the code.
If two threads concurrently execute ScopeReplacer.
In my case, simply not raising an exception in this situation would probably work, though I don't know if that would have any serious drawbacks (it looks to me like executing _import() twice won't have any real drawbacks, but it's not obvious).
File "/var/launchpad
report_
File "/var/launchpad
ui.ui_
File "/var/launchpad
_cleanup()
File "/var/launchpad
del self._factory
AttributeError: _factory
Related branches
- Martin Packman (community): Needs Fixing
- Jelmer Vernooij (community): Abstain
- Vincent Ladeuil: Needs Information
- John A Meinel: Pending requested
- Benji York: Pending requested
-
Diff: 304 lines (+115/-82)3 files modifiedbzrlib/builtins.py (+11/-2)
bzrlib/lazy_import.py (+67/-53)
bzrlib/tests/test_lazy_import.py (+37/-27)
Changed in bzr: | |
status: | Triaged → Confirmed |
tags: | added: lazy-imports |
Changed in loggerhead: | |
status: | New → Triaged |
importance: | Undecided → Critical |
tags: | added: oops |
Changed in bzr: | |
assignee: | Benji York (benji) → nobody |
Changed in loggerhead-breezy: | |
status: | New → Triaged |
importance: | Undecided → High |
status triaged
importance high
I suspect this is the cause for launchpad-code, and test runs of just a
couple of tests encountering scope errors in the smart server from time
to time.
-Rob