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:
- Does it affect NDB transations? NDB documentation doesn't mention it, but I suppose that this behavior is inherited
- What can cause this type of situation?
- How often can it happen?
- Can I prevent it, or decrease probability?
- Are transactional tasks enqueued in this situation?
- Is this situation a bug, which will be fixed in the future, or a feature, which I should just get used to?