From: Ian B. <ia...@co...> - 2003-04-14 21:55:47
|
On Mon, 2003-04-14 at 14:52, Luke Opperman wrote: > Symptoms: We've been having SQLObject completely hang the > python interpreter on a regular basis, after some digging > it turned out to be during Cache lookups. More > specifically, if you stored an object, then destroyed it > (purge in Cache), then tried to do a lookup for that id in > the cache again (expecting failure), it would hang. Having > found the problem, it's likely this behavior could happen > at other points, but that's the easy way to duplicate. :) Hmmm... purge, delete, etc, aren't well thought out yet. I.e., they don't ensure consistency. > Fix: Cache.py is missing a lot of lock statements. I've > attached a fixed version with "## LDO" comments, they are > all in get() or put(). Actually there shouldn't be a locks there -- if None is returned from get(), the caller is responsible for creating an object and putting it into the cache with put(). Otherwise you can't be sure that two objects won't be created. I have a feeling if there's a problem, it's in SQLObject.__new__, where maybe it isn't careful enough about this sequence of calls. Anyway, I'll look at this more closely later. Taxes due tomorrow :( Ian |