__storm_loaded__ called on empty object
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
Fix Released
|
Medium
|
Thomas Herve |
Bug Description
I don't know why, but we're triggering the stack below.
What it shows is:
- an object loaded by a query
- that is in the object cache [but only the id is populated]
- has its __storm_loaded__ hook called *before* the object is fully populated
- which triggers a single lookup of that object
This throws out the query count and is likely making some stuff rather slower than it needs to be, in the places we're using __storm_loaded__
The cause is _get_object's hook running. I have a workaround which is to not run the hook in this particular code path; branch coming soon : but you get to write tests :)
File "/home/
yield self._load_
File "/home/
return self._find_
File "/home/
values[
File "/home/
obj = self._get_
File "/home/
self.
File "/home/
func()
File "/home/
self.
File "/home/
if self.teamownerID is not None:
File "/home/
return obj_info.
File "/home/
result = self._connectio
File "/home/
return Connection.
File "/home/
raw_cursor = self.raw_
File "/home/
return Connection.
File "/home/
statement, params or ())
File "/home/
return function(*args, **kwargs)
File "/home/
attr(*args, **kwargs)
File "/home/
traceback.
Related branches
- Gustavo Niemeyer: Disapprove
- Storm Developers: Pending requested
-
Diff: 43 lines (+11/-6)1 file modifiedstorm/store.py (+11/-6)
- Jamu Kakar (community): Approve
- Gustavo Niemeyer: Approve
-
Diff: 118 lines (+42/-11)2 files modifiedstorm/store.py (+9/-9)
tests/store/base.py (+33/-2)
Changed in storm: | |
importance: | Undecided → Medium |
milestone: | none → 0.18 |
Changed in storm: | |
assignee: | nobody → Thomas Herve (therve) |
status: | New → In Progress |
Changed in storm: | |
status: | In Progress → Fix Committed |
Changed in storm: | |
status: | Fix Committed → Fix Released |