During Contention, Entities are Returned None in NDB Transactions

62 views
Skip to first unread message

Kaan Soral

unread,
Nov 3, 2016, 7:19:44 AM11/3/16
to Google App Engine
Hi

With high retry[60] ndb transactions, I'm getting 2 contention exceptions (2 consecutive "TransactionFailedError(too much contention on these datastore entities..." logs), on the third retry, the get routine returns None instead of the entity, and the routine fails with an exception trying to access a property of None

Is this expected?

It's highly unexpected to me

As an additional info, it's an "XG" transaction, the "None" entity is the second entity that's fetched after an exception is logged for the first entity

Kaan Soral

unread,
Nov 3, 2016, 7:32:19 AM11/3/16
to Google App Engine
And to clarify, both entities are fetched by using the id's of entities that are outside the transaction, so it's not a missing dependency thing

Nicholas (Google Cloud Support)

unread,
Nov 4, 2016, 1:44:45 PM11/4/16
to Google App Engine
Hey Kaan,

This is interesting indeed.  It's not entirely clear from this description if this is expected behavior or an issue with the platform.  As it is however, I believe this post would be better suited as a Defect Report on the App Engine public issue tracker.  If you file the public issue, I would recommend also providing the following:
  • A trimmed down reproduction to speed up the investigation.  This is the quickest way to get all the specific details of your models, transactions and handlers interacting with them.
  • The circumstances under which you encountered this.  Knowing the request load, frequency, etc. will help us better understand how easy it is to encounter this behavior.
Also, feel free to post a link to the issue here so that readers can follow through if they are also experiencing this issue.

Cheers,
Nicholas
Reply all
Reply to author
Forward
0 new messages