Hi Marcus,

The error rate makes me think these are transient errors, so it should
be safe to retry. Be sure to catch the specific exception, since there
are other reasons that a datastore get might fail more consistently.
(like an invalid key name ;-)

Timeouts can also indicate datastore contention since repeated writes
to the same entity (or entity group) can queue up and take too long to
complete, but this would not be the case for gets.

Happy coding,

Jeff

On Apr 6, 12:17 am, Marcus <[email protected]> wrote:
> Hello Jeff!
>
> Thanks for your reply.
>
> I would estimate that it is around 0.04% of the calls that fails.
>
> Would it help to catch the timeout exception and do a retry directly
> again or would that also fail?
>
> I am mostly worried that the data from the users will go lost.
>
> /Marcus
>
> On Apr 4, 3:02 am, Jeff S <[email protected]> wrote:
>
> > Hi Marcus,
>
> > You are correct that get_by_key_name does tend to be a very efficient
> > query, but it is possible to see atimeoutthough this is usually
> > quite rare as a percentage of overall requests. Do you have a feel for
> > what percentage of these get operations are timing out?
>
> > Thank you,
>
> > Jeff
>
> > On Apr 2, 1:06 am, Marcus <[email protected]> wrote:
>
> > > Hello!
>
> > > I am getting some timeouts in my app. My app uses get_by_key_name
> > > along with alot of other database accessing. I get around 5-10 timouts
> > > each day and it is always get_by_key_name that times out, never any
> > > other database acceses.
>
> > > Why could this be? Is there a way to protect the app from these
> > > timeouts. I thought get_by_key_name was a fast access to the database.
> > > The app have akeythat is around 20 characters long and the app have
> > > quite a lot of users (I guess around 200 000).
>
> > >   File "/base/python_lib/versions/1/google/appengine/ext/db/
> > > __init__.py", line 849, in get_by_key_name
> > >     return get(*keys)
> > >   File "/base/python_lib/versions/1/google/appengine/ext/db/
> > > __init__.py", line 1044, in get
> > >     entities = datastore.Get(keys)
> > >   File "/base/python_lib/versions/1/google/appengine/api/
> > > datastore.py", line 221, in Get
> > >     raise _ToDatastoreError(err)
> > >   File "/base/python_lib/versions/1/google/appengine/api/
> > > datastore.py", line 1965, in _ToDatastoreError
> > >     raise errors[err.application_error](err.error_detail)
> > >Timeout
>
>
--~--~---------~--~----~------------~-------~--~----~
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