Hi Nick,

Thank you very much for your reply.

The contention is identified in the log:


   1.

   198.66.245.68 - - [22/Apr/2009:10:19:43 -0700] "GET
/setlocation?ll=40.064929,-75.242851&uid=e5b25e2d512b10fc913c2f8c290f55114550135a&c=28
HTTP/1.1" 500 916 - "gzip(gfe)"

   2.  E 04-22 10:19AM 43.004

   too much contention on these datastore entities. please try again.
   Traceback (most recent call last):
     File "/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py",
line 501, in __call__

       handler.get(*groups)
     File "/base/data/home/apps/grindrservr/3.332855696947742792/main.py",
line 921, in get
       user.put()
     File "/base/python_lib/versions/1/google/appengine/ext/db/__init__.py",
line 669, in put

       return datastore.Put(self._entity)
     File "/base/python_lib/versions/1/google/appengine/api/datastore.py",
line 166, in Put
       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)
   TransactionFailedError: too much contention on these datastore
entities. please try again.



But I must admit that although this request can only cause a put() on that
specific record once every five minutes there could also come a put() from
another request. But my guess is that at most two puts on the same record
can happen within a short period of time.

Can the contention be caused by just two puts? I guess it could...

Would it be an idea to catch this exception and try the put again?

Sincerely,
/morten

On Thu, Apr 23, 2009 at 10:46 AM, Nick Johnson <nick.john...@google.com>wrote:

>
> Hi Morten,
>
> The likelihood you'll see a datastore timeout bears a relation to how
> expensive your operation is, but external factors - such as transient
> issues on our Bigtable Tabletservers - can have a much larger impact.
> As such, you'll occasionally (hopefully only very occasionally) see
> timeouts even on 'simple' operations like retrieving an entity by its
> key. The best approach is generally to retry the operation in
> circumstances like these.
>
> Regarding contention, how are you identifying it as such? Are you
> using explicit transactions, and getting TransactionFailedError? This
> is usually due to contention, but could also be caused by multiple
> timeouts.
>
> -Nick Johnson
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to