odd error from heat list after a delete
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
Low
|
Unassigned |
Bug Description
[root@bigiron functional]# heat list
ERROR:Failed to list. Got error:
ERROR:Internal Server error: <ErrorResponse>
I was not able to reproduce.
I think I deleted a stack followed by a heat list.
This may or MAY NOT be the backtrace - I wasn't able to correlate it.
2012-09-12 09:02:35 ERROR [heat.openstack
Traceback (most recent call last):
File "/usr/lib/
rval = self.proxy.
File "/usr/lib/
return getattr(proxyobj, method)(ctxt, **kwargs)
File "/usr/lib/
return {'stacks': [format_
File "/usr/lib/
return api.format_
File "/usr/lib/
STACK_CREATION_
File "/usr/lib/
o.refresh(
File "/usr/lib/
session.
File "/usr/lib64/
mapperutil.
InvalidRequestE
2012-09-12 09:02:35 ERROR [heat.openstack
zane
======
This is caused by the entry being deleted out of the database between when we start listing stacks and when we go to look up the latest updated time (which is reloaded on demand).
Eventually we will stop deleting stacks from the database as soon as we are done with them and this problem will be much less likely to occur.
sdake
=====
Reading the sqlalchemy docs, it looks like multiple unique sessions will automatically reference count and not allow the above to happen. From the docs:
http://
"
Objects become detached if their owning session is discarded. They are still functional in the detached state if the user has ensured that their state has not been expired before detachment, but they will not be able to represent the current state of database data. Because of this, it’s best to consider persisted objects as an extension of the state of a particular Session, and to keep that session around until all referenced objects have been discarded.
An exception to this is when objects are placed in caches or otherwise shared among threads or processes, in which case their detached state can be stored, transmitted, or shared. However, the state of detached objects should still be transferred back into a new Session using Session.add() or Session.merge() before working with the object (or in the case of merge, its state) again.
"
Since we are using goofy greenthreads, I expect we are having a concurrency problem. I am not certain how greenthreads and sqlalchemy should operate based upon the above detached operating model. Note the code expires the objects on commit. It may be that we need unique objects for each unique thread, but again I don't understand how the threadlocal functionality is supposed to work with greenthreads (is it supposed to work?) as each API operation is a unique operation.
One simple hack would be to get rid of the expire on commit, but I'm not clear on when we should expire in this condition.
Brain hurts. bedtime.
zane
=====
It's happening because we explicitly go and retrieve the last updated time from the database (see https:/
I think the best solution is probably just to ignore the exception if this fails and report whatever last updated time we had cached.
Changed in heat: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in heat: | |
milestone: | none → grizzly-3 |
Changed in heat: | |
milestone: | grizzly-3 → none |
I think this was fixed in this bug: https:/ /bugs.launchpad .net/heat/ +bug/1193132