应用引擎数据存储事务异常 [英] app engine datastore transaction exception

查看:24
本文介绍了应用引擎数据存储事务异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在应用引擎交易文档中,我发现了以下注释:

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

注意:如果您的应用在提交交易时收到异常,这并不总是意味着交易失败.你可以收到超时、TransactionFailedError 或 InternalError 异常情况事务已提交并最终将被应用的地方成功地.只要有可能,就让您的 Datastore 事务幂等,因此如果您重复交易,最终结果将是一样.

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. 它会影响 NDB 交易吗?NDB 文档没有提到它,但我认为这种行为是继承的
  2. 什么会导致这种情况?
  3. 这种情况多久发生一次?
  4. 我可以预防它,或降低概率吗?
  5. 事务性任务是否在这种情况下排队?
  6. 这种情况是一个错误(将来会修复)还是一个我应该习惯的功能?
  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?

推荐答案

是的,它也会影响 ndb.

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.

这篇关于应用引擎数据存储事务异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆