We are facing the same issue thought we have non-transnational. Any ideas ? 

Here is the stacktrace:

  File 
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py",
 line 1077, in put
    return datastore.Put(self._entity, **kwargs)
  File 
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/datastore.py",
 line 605, in Put
    return PutAsync(entities, **kwargs).get_result()
  File 
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py",
 line 613, in get_result
    return self.__get_result_hook(self)
  File 
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/datastore/datastore_rpc.py",
 line 1881, in __put_hook
    self.check_rpc_success(rpc)
  File 
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/datastore/datastore_rpc.py",
 line 1373, in check_rpc_success
    raise _ToDatastoreError(err)
TransactionFailedError: too much contention on these datastore entities. please 
try again.



On Thursday, August 4, 2011 at 7:18:37 PM UTC+5:30, Joshua Smith wrote:
>
> This is a weird one.
>
> I have a cron that rolls up some data every few minutes.  Nothing too 
> complicated:
>
> class CollectStatsHandler(webapp.RequestHandler):
>   def get(self):
>     nodes = NodeModel.gql("WHERE online = :1 and procs > :2", True, 
> 0).fetch(1000)
>     sum = 0
>     for n in nodes:
>       sum = sum + n.procs
>     now = datetime.datetime.now().timetuple()
>     hour = datetime.datetime(now[0], now[1], now[2], now[3])
>     hourly = HourlyStatsModel.gql("WHERE hour = :1", hour).get()
>     if not hourly:
>       hourly = HourlyStatsModel()
>       hourly.hour = hour
>       hourly.stats = str(sum)
>     else:
>       hourly.stats = hourly.stats + "," + str(sum)
>     hourly.put()    
>
> I'm running on M/S, so every now and then I'll get timeouts or whatever, 
> but that's OK because this is really just for my internal "app health" 
> dashboard.
>
> Anyway, yesterday I got this exception:
>
> google.appengine.api.datastore_errors.TransactionFailedError@/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py:1074
>  
> (at least 2 occurrences)Handler:main.pyURL:
> http://mesonstreaming.appspot.com/admin/collectStatsStacktrace:
>
> Traceback (most recent call last):
>   File 
> "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py",
>  line 700, in __call__
>     handler.get(*groups)
>   File "/base/data/home/apps/mesonstreaming/51.352130110004909428/main.py", 
> line 1677, in get
>     hourly.put()
>   File 
> "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py",
>  line 1006, in put
>     return datastore.Put(self._entity, config=config)
>   File 
> "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py",
>  line 467, in Put
>     return PutAsync(entities, **kwargs).get_result()
>   File 
> "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py",
>  line 658, in get_result
>     results = self.__rpcs[0].get_result()
>   File 
> "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py",
>  line 592, in get_result
>     return self.__get_result_hook(self)
>   File 
> "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py",
>  line 1385, in __put_hook
>     self.check_rpc_success(rpc)
>   File 
> "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py",
>  line 1074, in check_rpc_success
>     raise _ToDatastoreError(err)
> TransactionFailedError: too much contention on these datastore entities. 
> please try again.
>
>
> So we have a transaction failed error on a put which is NOT a transaction.
>
> And we have too much contention on an entity which is written once every 5 
> minutes by a cron.
>
> Huh?
>
> -Joshua
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/474d3b75-c056-4af1-a8ae-cc6a1f81cb53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to