app engine datastore transaction exception

寵の児 提交于 2020-01-30 12:08:16

问题


In app engine transactions documentation I have found the following note:

Note: If your app receives an exception when submitting a transaction, it does not always mean that the transaction failed. You can receive Timeout, TransactionFailedError, or InternalError exceptions in cases where transactions have been committed and eventually will be applied successfully. Whenever possible, make your Datastore transactions idempotent so that if you repeat a transaction, the end result will be the same.

This is quite general information and I wasn't able to find more details. I have the following questions regarding this issue:

  1. Does it affect NDB transations? NDB documentation doesn't mention it, but I suppose that this behavior is inherited
  2. What can cause this type of situation?
  3. How often can it happen?
  4. Can I prevent it, or decrease probability?
  5. Are transactional tasks enqueued in this situation?
  6. Is this situation a bug, which will be fixed in the future, or a feature, which I should just get used to?

回答1:


Yes, it affects ndb too.

Potential causes include network partitions where the datastore server commits successfully but cannot communicate the result to the app.

It is rare, but cannot be prevented, and will never be fixed. It is inherent to all distributed systems.

Task queue adds are committed with the transaction by the datastore server.



来源:https://stackoverflow.com/questions/13740724/app-engine-datastore-transaction-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!