You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
commit() can raise after a transaction was applied, and a failing BatchWriter block drops queued writes #83
commit() can raise after DynamoDB applied the transaction (transactions.py, the refresh after commit; repository.py, _evaluate). Instances are refreshed by evaluating the update on the item as it was loaded. For an unversioned instance whose item changed meanwhile, _apply_update can fail (list_append to an attribute another writer removed), and commit() raises a ValidationError, which normally means "not applied", leaving the instance unrefreshed. A caller who retries applies the change twice. Refresh failures after a commit should not raise as if the commit failed (reload the item, or mark the instance as not loaded).
BatchWriter.__aexit__ drops the queued writes when the block raises (batch.py), including writes that a failed automatic flush inside await batch.put() kept queued, as the docs promise ("what a failed flush did not write stays queued"), because that exception ends the block. It may be intended, like transactions, but it is not documented.
Found in a review of the library for bugs (fctl session); the fixes that fit in its ten pull requests are #61 to #65, #67 to #70 and #72.
Activity
fix(transactions): commit() no longer raises after the transaction wa…