Seems to fluctuate between an 'internal error' and the deadline
exceeded error.

On Nov 26, 7:09 pm, Fred <[EMAIL PROTECTED]> wrote:
> I'm getting timeouts at the moment when fetching a single item from
> the datastore:
>
> Traceback (most recent call last):
>   File "/base/python_lib/versions/1/google/appengine/ext/webapp/
> __init__.py", line 499, in __call__
>     handler.get(*groups)
>   File "/base/data/home/apps/mycycleroute/1.329543171657420466/
> main.py", line 1583, in get
>     'greeting' : getUserGreeting(self),
>   File "/base/data/home/apps/mycycleroute/1.329543171657420466/
> main.py", line 1773, in getUserGreeting
>     userPreferencesQuery = db.GqlQuery("SELECT * FROM UserPreferences
> WHERE user = :1", user).fetch(1)
>   File "/base/python_lib/versions/1/google/appengine/ext/db/
> __init__.py", line 1377, in fetch
>     raw = self._get_query().Get(limit, offset)
>   File "/base/python_lib/versions/1/google/appengine/api/
> datastore.py", line 938, in Get
>     return self._Run(limit, offset)._Next(limit)
>   File "/base/python_lib/versions/1/google/appengine/api/
> datastore.py", line 879, in _Run
>     apiproxy_stub_map.MakeSyncCall('datastore_v3', 'RunQuery', pb,
> result)
>   File "/base/python_lib/versions/1/google/appengine/api/
> apiproxy_stub_map.py", line 46, in MakeSyncCall
>     stub.MakeSyncCall(service, call, request, response)
>   File "/base/python_lib/versions/1/google/appengine/runtime/
> apiproxy.py", line 246, in MakeSyncCall
>     rpc.CheckSuccess()
>   File "/base/python_lib/versions/1/google/appengine/runtime/
> apiproxy.py", line 189, in CheckSuccess
>     raise self.exception
> DeadlineExceededError: The API call datastore_v3.RunQuery() took too
> long to respond and was cancelled.
>
> :(
>
> This is on the front page of my site!
>
> On Nov 26, 4:27 am, Rob <[EMAIL PROTECTED]> wrote:
>
> > Hi Marzia,
>
> >   Thanks again for the help.  I've done some careful tracing through
> > my code to document exactly the number of datastore requests on a
> > typical failure.  I believe they are very minimal but I'd be very
> > interested to hear your advice.
>
> > > Is that the only datastore query in the request, or does the request also
> > > contain other datastore queries?  To clarify, it may be timing out here 
> > > as a
> > > result of the total number of results fetched in the entire request.
>
> > Here is a list of the datastore gets and puts that are called, in
> > order for a typical failed execution.  There are no queries which
> > return more than a single Entity and I tried to grab the database
> > Entities directly by id when possible:
>
> >     # Grabs a single player out of the database by id
> >     self.db = datamodel.PlayerDb2.get(db.Key(id))
>
> >     # Checks the state of a single room (by id)
> >     self.db = id
> >     data = self.db.state
>
> >     # For the current player, checks the list of drawers
> >     # to verify the player is not next to draw
> >     if self.db.wannaDrawList and len(self.db.wannaDrawList):
> >       return self.db.wannaDrawList[0]
>
> >     # Updates the player's last connection time and
> >     # puts it back into the database
> >     self.db.lastPing = time
> >     self.db.put()
>
> > I just did a scan of my recent errors in my logs and it appears that
> > the total execution time for all of the above commands (plus the logic
> > surrounding it) is about 80 to 130ms.  This part never seems to time
> > out--but the problem query below seems to hang for several seconds
> > before regularly timing out.  In addition, I used to have many more
> > database accesses in this part of the code before and those have all
> > been removed in order to try to fix the consistent time outs for the
> > "pruneInactive" function.  So far I've never been able to move the
> > timeout around or see it fail in another place.
>
> > Here is the current version of the pruneInactive function where the
> > timeout happens:
>
> > ------ Code Snippet ------
>
> >         # first, grab all the players who's ping is older than 10
> > seconds in our room
> >         # 8 maximum players per room
> >         query = datamodel.PlayerDb2.all()
> >         query.filter("room =", self.db.room)
> >         query.filter("lastPing <", time.time() - TIMEOUT_TIME)
>
> >         logging.debug("Query is built\n")
>
> >         # Run the query for up to 5 players
> >         results = query.fetch(5)  # this is the timeout line
> >         logging.debug("Query is executed (limit 5)\n")
>
> >             ...
>
> > ------ End Code Snippet ------
>
> > Thanks again for your help with this confusing issue.  (At least it's
> > confusing to me!)
>
> > Sincerely,
>
> > Rob
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to