I have a problem. I'm getting datastore timeouts when doing reads. The
code finished about 5% of the time. The code looks like:
alerts = Alert.all().filter('expires >= ', datetime.datetime.now())
# ge active alerts
for alert in alerts:
#get the db.Keys from the ListProperty
zones = ZoneMaster.get(alert.zones)
for zone in zones:
if zone:
#get the users for this zone
if zone.siteusers:
us = SiteUser.get(zone.siteusers)
for u in us:
if u:
self.response.out.write(
u.name + '<br />')
The Model looks like:
class Alert(db.Model):
effective = db.DateTimeProperty()
expires = db.DateTimeProperty()
zones = db.ListProperty(db.Key)
class ZoneMaster(db.Model):
siteusers = db.ListProperty(db.Key)
class SiteUser(db.Model):
name = db.StringProperty()
zone = db.ReferenceProperty(ZoneMaster)
This code is repeatably timing out with a "Timeout: datastore timeout:
operation took too long." error.
I'm not doing any writes. All the reads are by key (that come from a
ListProperty). Why would this be timing out?
Thanks.